Computer Architecture, Languages and Operating Systems: - Ramiro Advincula, LPT, MSIT
Computer Architecture, Languages and Operating Systems: - Ramiro Advincula, LPT, MSIT
Computer Architecture,
Languages and
Operating Systems
-Ramiro Advincula, LPT, MSIT
Learning Objectives
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
■ 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