1 / 12

Computer Science 101

Computer Science 101 . Computer Systems Organization Machine Language Examples Entire machine. Hypothetical Lab Machine. Memory ALU Control. PC(12). IR(16). MAR(12). MDR(16). 16. +1. R(16). ALU. GT. EQ. LT. Hypothetical Machine Instructions. Opcode Operation Meaning

kenda
Download Presentation

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 Machine Language Examples Entire machine

  2. Hypothetical Lab Machine Memory ALU Control PC(12) IR(16) MAR(12) MDR(16) 16 +1 R(16) ALU GT EQ LT

  3. Hypothetical Machine Instructions • Opcode Operation Meaning 0000 Load X Con(X)R 0001 Store X RCon(X) 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)

  4. Hypothetical Machine Instructions • Opcode Operation Meaning 0111 Compare X If Con(X) > R CC: 100,etc. 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

  5. Hypothetical Machine Instructions • Opcode Operation Meaning 1101 In X Input valueCon(X) 1110 Out X Con(X)Output value 1111 Halt Stop execution

  6. 0011000000000110 Add 6 0001000000000111 Store 7 1111000000000000 Halt 0000000000101100 0000000000101100 0000000000001011 0000000000110111 0000000000110111 0000000000000101 Load 5 Machine Language: Con(5)+Con(6)  Con(7) Python: c = a + b 0: 0000000000000101 1: 0011000000000110 2: 0001000000000111 3: 1111000000000000 4: 0000001000001010 5: 0000000000101100 6: 0000000000001011 7: 0000001111111111 1111000011110000 R:

  7. Fetch Phase PC MAR Fetch MDR IR PC+1 PC Decode IRop ALU MUX Memory ALU Control PC(12) IR(16) MAR(12) MDR(16) 16 +1 R(16) ALU Micro Steps: Fetch and Decode Phases

  8. Load X IRadd MAR Fetch MDR R Store X IRadd  MAR R  MDR Store Memory ALU Control PC(12) IR(16) MAR(12) MDR(16) 16 +1 R(16) ALU Micro Steps: Execution of Load and Store

  9. Add X IRadd MAR Fetch MDR ALU R  ALU Add ALU  R Jump X IRadd  PC Memory ALU Control PC(12) IR(16) MAR(12) MDR(16) 16 +1 R(16) ALU Micro Steps: Execution of Add and Jump

  10. Compare X IRadd MAR Fetch MDR ALU R  ALU Subtract (set CC) JumpGT If GT=1 IRadd PC Memory ALU Control PC(12) IR(16) MAR(12) MDR(16) 16 +1 R(16) ALU Micro Steps: Execution of Compare and JumpGT

  11. If you mean add, just say ADD.

More Related