Lecture 1: Machine Organization Flashcards
operating system
operating system
a program that acts as an intermediary between user of a computer and the computer hardware.
computer system structure
- hardware
- operating system
- application programs
- users
Machine Organization
- CPU: a processor for interpreting and executing programs
- Memory: for storing data and programs
- Controller: mechanism for transferring data from/to outside world (devices). It transfers the data on the bus, through the bus
Bus: sets of wires (zeros and ones), each “on” or “off”: move data and instructions within units of the machine. All data is interpreted as zeroes and ones (binary).
Bus
The bus is divided into 2 sets:
data(what), address(where)
Primary movement of the bus:
Data is moved from:
1. From CPU to Memory
(and from Memory to CPU)
2. From CPU to the device controllers (disk)
3. From memory to device controllers (sometimes)
CPU
Central Processing Unit
=ALU + Control Unit
CPU os responsible for fetching, decoding and executing instructions on the correct data.
ALU
Arithmetic Logical Unit
= registers + function unit
-It stores and performs operations on data
Registers: storage units (for addresses, program counters, data)
Function Unit: arithmetic and logic Units
Control Unit
- Interprets program instructions
- Makes sure the correct data is where it needs to be.
Registers
- Fast Expensive Memory on the Processor
- 32-64 registers in ALU
- Each holds a “word”
- word is data size used in computation
- word is data transferrable over data bus at a time
Types: General Purpose Registers (GPR) and Status Registers
Function Unit
- performs logical and arithmetic computations with data in registers
e. g. ADD R1, R2 –> R1: =R1+R2 - Operations in FU may affect bits in status registers (e.g. overflow, zero flag)
- knows which operations to perform because it is controlled by signals from the Control Unit of the CPU
General Purpose Register (GPR)
- All data used in computation is stored in General Purpose Registers.
- Set directly by software (assembly language instruction)
Mem to CPU Operations (Assembly Language )
LOAD: Mem->Reg
STORE: Reg ->Mem
Mem to Disk (System Calls)
- Request OS to perform service
- Causes it to cede control of CPU (trap)
READ R1: : Disk -> Reg
WRITE R1: : Reg -> Disk
Status Register
- convey info about previous and current operation
e. g. CPM R1, R2 - Set as “side effect” of software
Program Counter (PC)
- register of the CPU that stores where the program where the program is stored in emory
- The register containing the address of the instruction in the program being executed.
Instruction Register (IR)
register of a CPU’s control unit that holds the instruction currently being executed or decoded