1 / 19

Computer Science 101

Computer Science 101 . Computer Systems Organization ALU, Control Unit, Instruction Set. CPU. Major Components. Bus. Memory. Input Output Units. Control Unit. ALU. ALU. ALU - Arithmetic Logic Unit. Consists of Bank of registers Operation Circuitry

lumina
Télécharger la présentation

Computer Science 101

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set

  2. CPU Major Components Bus Memory Input Output Units Control Unit ALU

  3. ALU ALU - Arithmetic Logic Unit • Consists of • Bank of registers • Operation Circuitry • ALU Control Circuitry • Connections Result L R R0 R1 R15

  4. Multiplexor - Review • 2n input lines • 1 output line • n control lines • control lines “select” one of the inputs to be “passed” to the output

  5. Zoom in on ALU R15 + - Mux Control

  6. R + - Mux Control Simple Hypothetical Lab Machine • One Register • One Operand

  7. Control Unit • Cycle • Fetch next instruction from memory • Decode instruction • Execute it by giving proper control signals to ALU and memory.

  8. Control Unit Registers • The Program Counter(PC) is a register in the control unit which holds the address of the nextinstruction to execute. • The Instruction Register(IR) is a register in the control unit which holds the current instructionbeing executed.

  9. Machine Language • Instruction Set - set of instructions (binary) that the specific type of machine can execute. • Instruction typically has • Opcode field - set of bits telling which instruction • Address fields - memory or register address where operands will be found.

  10. Opcode Address 0110 001101010011 Instruction form for hypothetical machine • 4-bit opcode field - 16 instruction types • 12-bit address field- 4096 memory cells

  11. Machine Language Groups • Data Transfer • Arithmetic • Compare • Branch

  12. Data Transfer instructions • General machine • Memory cell  ALU register • ALU register  Memory cell • Memory cell Memory cell • ALU register  ALU register

  13. 12-bit address Data Transfer instructions • Hypothetical machineOpcode Operation Meaning 0000 Load X Con(X)R 0001 Store X RCon(X) Content stored at address X

  14. Arithmetic - ADD,SUB,AND,etc. • Hypothetical machineOpcode Operation Meaning 0010 Clear X 0Con(X) 0011 Add X R+Con(X)R 0100 Increment X Con(X)+1 Con(X) 0101 Subtract X R-Con(X) R 0110 Decrement X Con(X)-1 Con(X)

  15. Compare instructions - Compare values and set an indicator. • Condition Code Register (CC): 3 bit register with bits GT, EQ, LT. • When two values are compared, the result of the comparison will be stored in the CC – was the result GT, EQ, or LT. • Later instructions can look at CC to see what happened with the last comparison.

  16. Compare instructions - Compare values and set an indicator. • Hypothetical machineOpcode Operation Meaning 0111 Compare X If Con(X) > R CC: 100 else if Con(X)<R CC: 001 else CC: 010

  17. Branch instructions - Alter flow of control based on CC. • Hypothetical machineOpcode Operation Meaning 1000 Jump X X  PC 1001 JumpGT X If GT=1, X  PC 1010 JumpEQ X If EQ=1, X  PC 1011 JumpLT X If LT=1, X  PC 1100 JumpNE X If EQ=0, X  PC

  18. Input/Output and Halt • Hypothetical machineOpcode Operation Meaning . 1101 In X Input valueCon(X) 1110 Out X Con(X)Output value 1111 Halt Stop execution

  19. Could you pass that by me again, please?

More Related