Basic Computer Organization Background for CS260
Basic Components CPU Main Memory External Memory I/O devices Bus
CPU Main Memory VideoDisk Drive All devices communicate through the bus with each other and with the CPU. CPU access of the bus takes precedence. Main Bus
CPU – a very simple one! Accumulator Instruction Reg ALU Stack Pointer Flags external bus internal bus
a b MEMORY addresses values
EXAMPLE OPERATION Changing the value of a memory location (decrement by 2) a b 104
a b LOAD value from memory into the CPU’s accumlator 106 accumulator 1.
a b SUBTRACT 2 from accumulator. Goes through the ALU 106 accumulator
a b STORE the result in the AC into the proper location in main memory Accumulator (AC)
What’s the connection? The operation in c would look like –I = I – 2; The operation in assembly language is –LOAD 101 –SUB 105 –STORE 101 More details involved More hardware knowledge required Not as clear to read/write/understand
We want to see the connection! C++ compiler assembly
Why? In order to better understand what we are actually instructing the computer to do when we write in the higher level language.