Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
36 views

Computer Architecture, Languages and Operating Systems: - Ramiro Advincula, LPT, MSIT

The document discusses key topics in computer architecture and operating systems. It begins by describing the Von Neumann architecture, which includes the central processing unit, memory, and input/output devices. It then explains the fetch-execute cycle by which the CPU fetches and executes instructions sequentially from memory. Finally, it discusses the role of operating systems in managing hardware, memory, security and running applications. It also explains the differences between high-level and low-level programming languages and the need for compilers, interpreters and assemblers to translate between them.

Uploaded by

Nope
Copyright
© © All Rights Reserved
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Computer Architecture, Languages and Operating Systems: - Ramiro Advincula, LPT, MSIT

The document discusses key topics in computer architecture and operating systems. It begins by describing the Von Neumann architecture, which includes the central processing unit, memory, and input/output devices. It then explains the fetch-execute cycle by which the CPU fetches and executes instructions sequentially from memory. Finally, it discusses the role of operating systems in managing hardware, memory, security and running applications. It also explains the differences between high-level and low-level programming languages and the need for compilers, interpreters and assemblers to translate between them.

Uploaded by

Nope
Copyright
© © All Rights Reserved
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Chapter 3

Computer Architecture,
Languages and
Operating Systems
-Ramiro Advincula, LPT, MSIT
Learning Objectives

■ Understand the basic Von Neumann


architecture
■ Describe the fetch-execute cycle
■ Describe the purpose of an operating
system
■ Understand low-level and high-level
languages, and why they are needed
■ Understand the need for compilers,
interpreters and assemblers
Von Neumann
Architecture
Von Neumann architecture
■ By John von Neumann
■ Three main sections
 Central processing unit (CPU) – also called the
‘processor’
 Storage – primary and secondary
 Input and output devices
■ Processor has direct access to memory
■ Both data and instructions are stored in the
memory
■ Individual instructions executed sequentially
Main Components

■ Control Unit (CU)


■ Immediate access store (IAS)
■ Arithmetic Logic Unit (ALU)
■ Registers
■ Input/Output Unit (I/OU)
■ Buses
Von Neumann model
Memory
(Contains both Data and Instructions)

Central
Processing
Unit (CPU)
Arithmetic and
Control
Logic Unit
Unit
(ALU)
(CU)
Accumulator

Input/Output Unit
(I/OU)
Central processing unit
(CPU)
■ Control unit
■ Arithmetic and Logic unit (ALU)
■ Special purpose registers
■ General purpose registers (accumulator is
one of them)
■ Clock
System bus
■ Connects the CPU, the memory and the input
and output (I/O) devices
■ Three components, each is a multiple wired
parallel connection
 Data bus is two-way
 Address bus is one-way CPU to memory
 Control bus is two-way
System bus
The fetch-decode-execute
cycle
■ A program is stored in memory as a
sequence of instructions
■ The CPU repeatedly handles individual
instructions in the following way:
 An instruction is fetched from memory into the
CPU
 The instruction is decoded
 The instruction is executed
The fetch-decode-execute
cycle

Fetch the
instruction

Execute the
instruction Decode the
instruction
Operating Systems
Operating Systems

■ The most vital software for the computer


■ A framework that allows people/users to
interact with the computer
■ May be text-based (CLI) or graphic (GUI)
■ Examples
 Windows 10 (Microsoft)
 MacOS Mojave (Apple)
 Linux (Open source)
Main functions of an OS

■ Provides GUI (or a way) for user to interact


with the computer
■ Manages hardware and peripherals
■ Manages memory
■ Divides/manages processing time and running
of applications
■ Manages security
■ Manages file handling
■ Manages/provides utility applications
Interrupts

■ A signal that is sent to and attended by the


operating system
■ Can come from
 Hardware
• key pressed on the keyboard
• Printer done printing
 Software
• A sub-program is called by the current program

■ Makes it possible for multitasking


Key Terms

■ Cache memory – a portion or memory


used for high speed storage
■ Register – an internal memory in the CPU
■ Accumulator – the register used by ALU
■ Peripheral – either an input or output
device connected to the computer
High-level and Low-
level Languages
High-level and low-level
languages
■ To provide instructions to the
computer, programming language is
needed
■ Two main types
 High-level
 Low-level
High-level language…

■ language that are easier for programmers to


understand
■ English-like statements
■ Some examples
 FORTRAN (Formula Translator), BASIC
(Beginners All-purpose Symbolic Instruction
Code), C, Pascal
 Java, C++, C#, Python
… High-level language

■ Not dependent on machine


■ Not focused (anymore) on memory
addresses, use of registers and operation
codes
■ Programs are easier to read and
understand
■ Sample Python source code:
• name = input(“What is your name?”)
• print(“Hello”, name)
Low-level language

■ Machine language
• The natural language of a computer
• Expressed in binary codes
• Also called ‘object codes’
• Difficult to understand
■ Assembly language
• A slightly simpler way to express an instruction
for the computer
• Uses mnemonic codes or mnemonics
• Still used to program device drivers
Some examples of
mnemonics
■ ADD – an instruction to use addition
■ SUB – an instruction to use subtraction
■ INP – an instruction to input data
■ OUT – an instruction to output data
An example of a program in
assembly language
INP #asks the user to do an input
STA ONE #stores the input in an address named ONE
INP #asks the user to do another input
ADD ONE #adds the second input to the value stored in ONE
OUT #outputs the result
HLT #stops the program
Comparison of High- and
Low-level languages
Low-level language High-level language
Includes machine language that uses Some examples are FORTRAN,
machine codes, and assembly language BASIC, C, Pascal, Java, C++,
(that uses mnemonics) C#, Python
Difficult to understand but can be easily Much easier to understand and
executed by a computer closer to humans’ natural
Machine language is the computer’s language
native language
Assembly language is close to machine
language
Assembly language needs an assembler Needs a compiler or interpreter
so that programs can be executed
One line of code does one unit of One line of code can include
operation many operations
Translators

■ Translators are programs that


translate a source code written in a
certain programming language into
machine language
 Compiler
 Interpreter
 Assembler
Compiler

■ A program that translates a source code written


in high-level programming language into
machine code
■ Compiling is the process of using the compiler
■ When there are errors in the source code,
compiling will be halted and the errors will be
reported
■ If compiling is successful, the translation is
saved into an executable file, usually with the
.exe extension
Interpreter

■ Also a program that translates a source code


written in high-level programming language
into machine code
■ Unlike a compiler, it does not create an
executable file but tries to execute the source
code directly line by line
■ When error is encountered, the execution of
the source code is halted
■ The source code is interpreted every time it
needs to be executed
Comparison of compiler and
interpreter
Compiler Interpreter
Translates source code completely into an Translates source code and executes it
executable file line by line (no executable file is created)
When errors are detected from the source When errors are detected, ‘interpretation’
code, compiling is halted and the errors is halted and errors are reported
are reported
Successfully compiled files can be later Source codes need to be interpreted
copied to similar machines and executed every time it is to be executed. If source
directly (no more compilation needed) code is copied to another machine, the
machine should have the interpreter so
source code can be executed
May need more memory during compiling Needs less memory during interpretation
to hold the entire translation before saving
it to a file secondary storage
Subsequent execution of compiled file is The speed of interpretation is always the
faster as no more compiling is needed same as the first time
Assembler

■ A program that translates a source


code written in assembly language
into machine code
■ The first stage of simplifying
programming
Key Terms

■ Syntax – the structure or rule for writing a


programming language
■ Source code – a set of instructions in text-based form
that is yet to be translated into machine code
■ Machine code – equivalent of source code in machine
language
■ Executable file – a file format that the computer can
readily process
■ Driver – a program that controls a device
References
■ https://www.youtube.com/watch?v=cNN_tTXABUA
■ https://en.wikibooks.org/wiki/A-
level_Computing/AQA/Computer_Components,_The_Stored_Program_Concept_and_the_Int
ernet/Machine_Level_Architecture/Structure_and_role_of_the_processor
■ www.teach-
ict.com/as_as_computing/ocr/H447/F453/3_3_3/vonn_neuman/miniweb/index.htm
■ http://en.wikibooks.org/wiki/A-
■ level_Computing/AQA/Computer_Components,_The_Stored_Program_Concept_and_
the_Internet/Machine_Level_Architecture/Structure_and_role_of_the_processor
■ www.teach-
ict.com/as_as_computing/ocr/H447/F453/3_3_3/fetch_execute_cycle/theory_fetch_e
xecute.html
■ http://en.wikibooks.org/wiki/A-
level_Computing/AQA/Computer_Components,_The_Stored_Program_Concept_and_
the_Internet/Machine_Level_Architecture/The_Fetch%E2%80%93Execute_cycle_an
d_the_role_of_registers_within_it
■ www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_1/interrupts/miniweb/pg4.htm
■ http://cse4k12.org/how_computers_work/index.html
■ http://www.eastaughs.fsnet.co.uk/cpu/execution-fetch.htm

You might also like