Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPS 101 Introduction to Computational Science Wensheng Shen Department of Computational Science SUNY Brockport.

Similar presentations


Presentation on theme: "CPS 101 Introduction to Computational Science Wensheng Shen Department of Computational Science SUNY Brockport."— Presentation transcript:

1 CPS 101 Introduction to Computational Science Wensheng Shen Department of Computational Science SUNY Brockport

2 Computer Instruction Sets Binary numbers Hexadecimal numbers Octal numbers Machine instructions

3 Binary numbers Base-2 number system, represents numeric values using two symbols, 0 and 1. 100 = 2 6 + 2 5 + 2 2

4 Hexadecimal numbers Base-16 number system, represents numeric values using 16 symbols, 0, 1, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f 100 = 6×16 1 + 4

5 Octal numbers Base-8 number system, represents numeric values using 16 symbols, 0, 1, 3, 4, 5, 6, and 7 100 = 8 2 + 4×8 1 + 4

6 Place-value system 908,305,688 =

7 Number conversion 01011110101101010010 2 5EB52 16 1365522 8 387922 10

8 The memory of the IAS consist of 1000 storage locations, call words, of 40 binary digits (bit) each. Both data and instructions are stored there. Hence, numbers must be represented in binary form, and each instruction also has to be a binary code. Each number is represented by a sign bit and a 39-bit value. A word may also contain two 20-bit instructions, with each instruction consisting of an 8-bit operation code (Op code) specifying the operation to be performed, and a 12-bit address designating one of the words in memory, number from 0 to 999 01 39 Sign bit (a) Number word Left instruction Right instruction 08 1928 20 39 Op code AddressOpcodeAddress

9 IAS - details Set of registers (storage in CPU) Memory Buffer Register (MBR) Memory Address Register (MAR) Instruction Register (IR) Instruction Buffer Register (IBR) Program Counter (PC) Accumulator (AC) Multiplier Quotient (MQ)

10 Structure of IAS – detail Fetch cycle and Execution cycle, which taken together is the Instruction cycle. Program control unit (PCU)

11 IAS Instruction Set

12 How IAS Computer Adds Two Numbers Suppose the numbers are stored in memory locations 200 and 201, and The sum is to be saved in memory location 202 InstructionOpcodeDescription LOAD M(200)00000001AC ← M(200) ADD M(201)00000101AC ← AC+M(201) STOR M(202)00100001M(202) ← AC

13 IAS Computer Instruction Code 00000001 000011001000 00000101 000011001001 00100001 000011001010 00000000 000000000000 Load200Add201 Stor202

14 Storage in Memory First program word Second program word Word 200 Word 201 Word 202 Address Memory Program Counter, PC Address 0 Address max

15 IAS Instruction Cycles Place the starting address in program counter (PC). Start program: MAR ← PC Read memory: IBR ← MBR ← M(MAR), fetch cycle Place left instruction in IR and address 200 in MAR Read memory: AC ← M(200), fetch cycle Place right instruction in IR and address 201 in MAR Read memory and add: AC ← AC + M(201), execution cycle PC ← PC + 1

16 IAS Instruction Cycles (Cont.) MAR ← PC Read memory: IBR ← MBR ← M(MAR), fetch cycle Place left instruction in IR and address 202 in MAR MBR ← AC Write memory


Download ppt "CPS 101 Introduction to Computational Science Wensheng Shen Department of Computational Science SUNY Brockport."

Similar presentations


Ads by Google