120 likes | 250 Views
CSE111: Great Ideas in Computer Science. Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739 alphonce@buffalo.edu. Announcements. First exam Wednesday next week Closed book Bring your UB card Monday next week: review. cell phones off (please). A flip-flop.
E N D
CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:50 645-4739 alphonce@buffalo.edu
Announcements • First exam Wednesday next week • Closed book • Bring your UB card • Monday next week: review
cell phones off (please)
A flip-flop R (reset) = 0 remembered value S (set) = 0
One-bit Half Adder A B S C
One-bit Full Adder A B S Cin Cout
Encoding machine instructions • Op-code + operands • Hardware decodes and executes
Computer Organization • Central Processing Unit (CPU) • Registers • General purpose (e.g. R1 – R16) • Special purpose (e.g. Program Counter and Instruction Register) • Arithmetic Logic Unit (ALU) • Memory
Computer Organization • Processor (CPU) • Memory (RAM) 11010010 R1 R2 00000001 11010010 . . . R16 00000010 11010010 00000011 11010010 PC IR 00000100 11010010 00000101 11010010 00000110 11010010 ALU 00000111 Each memory location has a unique address
A closer peek at the ALU 0110 1101 A B (half adder) COut S A B (full adder) CoutCIn S A B (full adder) CoutCIn S A B (full adder) CoutCIn S 1 0 1 0 0 1 0 1
Encoding instructions • Example • 1101000001000010 • 1101 000001 000010 • INSTR ARG1 ARG2 • ADD Reg1 Reg2
Instruction decoding • “ADD” • OP CODE • R2 • R1 • 1 1 0 1 0 0 0 0 0 1 0 0 0 0 1 0 • Circuitry to decode rest of instruction and carry it out (“execute” the instruction) This wire will carry a 1 only if the op code of the instruction is 1101.