Basic Computer Organization Background for CS260 Basic Components • • • • • CPU Main Memory External Memory I/O devices Bus Main Bus CPU Main Memory Disk Drive Video All devices communicate through the bus with each other and with the CPU. CPU access of the bus takes precedence. CPU – a very simple one! Accumulator Instruction Reg ALU Stack Pointer Flags internal bus external bus MEMORY addresses 100 17 101 106 a b 102 103 104 105 values EXAMPLE OPERATION Changing the value of a memory location (decrement by 2) 100 101 102 103 104 105 17 104 106 a b 106 accumulator 1. LOAD value from memory into the CPU’s accumlator 100 17 101 106 a b 102 103 104 105 104 106 accumulator 106 2 104 2. SUBTRACT 2 from accumulator. Goes through the ALU 100 17 101 106 a b 102 103 104 105 2 104 Accumulator (AC) 3. STORE the result in the AC into the proper location in main memory 100 17 101 104 106 a b 102 103 104 105 2 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.