BASIC COMPUTER ORGANIZATION AND DESIGN

Slides:



Advertisements
Similar presentations
BASIC COMPUTER ORGANIZATION AND DESIGN
Advertisements

Chapter 4 Register Transfer and Microoperations
M. Mateen Yaqoob The University of Lahore Spring 2014.
ARITHMETIC LOGIC SHIFT UNIT
Basic Computer Organization and Design
5 Computer Organization
Computer Organization and Architecture
Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009
Review We introduced registers
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Computer System Architecture ESGD2204
Chapter No 5 Basic Computer Organization And Design.
1 Basic Computer Organization & Design Computer Organization Computer Architectures Lab BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Exam2 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Chapter # 6 PROGRAMING THE BASIC COMPUTER.
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
M. Mateen Yaqoob The University of Lahore Spring 2014.
Lec 5 Basic Computer Organization
M. Mateen Yaqoob The University of Lahore Spring 2014
1 Basic Computer Organization & Design Computer Organization Prof. H. Yoon BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers.
Instruction.
Ch5. 기본 컴퓨터의 구조와 설계.
Basic architecture.
Chapter 4 Register Transfer and Microoperations Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
GROUP 2 CHAPTER 16 CONTROL UNIT Group Members ๏ Evelio L. Hernandez ๏ Ashwin Soerdien ๏ Andrew Keiper ๏ Hermes Andino.
8085 processor.
Basic Computer The following discussions are based on a fictitious computer called “Basic Computer” by the author of the textbook It’s a much better way.
Basic Computer Organization - Part 2 Designing your first computer
1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference.
Chapter 5 Computer Organization TIT 304/TCS 303. Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
REGISTER TRANSFER AND MICROOPERATIONS
PROGRAMMING THE BASIC COMPUTER
UNIT 2 REGISTER TRANSFER AND MICROOPERATIONS
Basic Computer Organization and Design
PROGRAMMING THE BASIC COMPUTER
Control Unit Lecture 6.
REGISTER TRANSFER AND MICROOPERATIONS
Chapter 4 Register Transfer and Microoperations
COMPUTER ARCHITECTURE
Symbol Hex Code Description I=0 I=1
PROGRAMMING THE BASIC COMPUTER
Micro-Operations A computer executes a program Fetch/execute cycle
William Stallings Computer Organization and Architecture
REGISTER TRANSFER LANGUAGE
ADVANCED PROCESSOR ARCHITECTURE
William Stallings Computer Organization and Architecture 7th Edition
Computer Organization and Design
BASIC COMPUTER ORGANIZATION AND DESIGN
Overview Instruction Codes Computer Registers Computer Instructions
Overview Instruction Codes Computer Registers Computer Instructions
Chapter 15 Control Unit Operation
BASIC COMPUTER ORGANIZATION AND DESIGN
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
سازمان و طراحي کامپيوتر پايه.
Assembler CASE Tool.
PROGRAMMING THE BASIC COMPUTER
Instruction and Control II
Computer Architecture and Organization: L11: Design Control Lines
William Stallings Computer Organization and Architecture 7th Edition
Chapter 14 Control Unit Operation
William Stallings Computer Organization and Architecture 8th Edition
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Computer Architecture and Organization: L07: Control Sequence
PROGRAMMING THE BASIC COMPUTER
UNIT – III Microprogrammed Control
Presentation transcript:

BASIC COMPUTER ORGANIZATION AND DESIGN • Instruction Codes • Computer Registers • Computer Instructions • Timing and Control • Instruction Cycle • Register Reference Instructions • Memory Reference Instructions

INSTRUCTION CODES • Program: A set of instructions that specify the operations, operands, and the sequence by which processing has to occur. • Instruction Code: A group of bits that tell the computer to perform a specific operation (a sequence of micro-operation) -->macro-operation - usually divided into operation code, operand address, addressing mode, etc. - basic addressing modes Immediate, Direct, Indirect • Simplest stored program organization In computer programming languages, the definitions of operator and operand are almost the same as in mathematics. In computing, an operand is the part of a computer instruction which specifies what data is to be manipulated or operated on, whilst at the same time representing the data itself. A computer instruction describes an operation such as add or multiply X, while the operand (or operands, as there can be more than one) specify on which X to operate as well as the value of X. Additionally, in assembly language, an operand is a value (an argument) on which the instruction, named by mnemonic, operates. The operand may be a processor register, a memory address, a literal constant, or a label. A simple example (in the x86 architecture) is MOV   DS, AXwhere the value in register operand 'AX' is to be moved into register 'DS'. Depending on the instruction, there may be zero, one, two, or more operands. Memory 4096x16 15 12 11 Opcode Address Instructions Instruction Format (program) 15 Binary Operand Operands (data) Processor register (Accumulator, AC)

Mano's Basic Computer Memory unit with 4096 l6-bit words Registers: AR, PC, DR, AC, IR, TR, OUTR, INPR, SC Flip-flops: I, S, E, R, IEN, FGI, FGO 3 x 8 op decoder and 4 x 16 timing decoder 16-bit common bus Control logic gates Adder and logic circuit connected to input of AC

INDIRECT ADDRESS + + Effective Address(EA) Instruction codes INDIRECT ADDRESS Instruction Format 15 14 12 11 I Opcode Address Direct Address Indirect address 22 ADD 457 35 1 ADD 300 300 1350 457 Operand 1350 Operand + + AC AC Effective Address(EA) The address, that can be directly used without modification to access an operand for a computation-type instruction, or as the target address for a branch-type instruction

COMPUTER REGISTERS Registers in the Basic Computer 11 PC 11 AR Memory 4096 x 16 15 IR 15 15 TR DR 7 7 15 OUTR INPR AC List of BC Registers DR 16 Data Register Holds memory operand AR 12 Address Register Holds address for memory AC 16 Accumulator Processor register IR 16 Instruction Register Holds instruction code PC 12 Program Counter Holds address of instruction TR 16 Temporary Register Holds temporary data INPR 8 Input Register Holds input character OUTR 8 Output Register Holds output character

Program Counter (PC) Holds memory address of next instruction to be executed. Next instruction is fetched after current instruction completes execution cycle. PC is incremented right after instruction is fetched from memory. PC value can be replaced by new address when executing a branch instruction

Register Control Inputs Load (LD) Increment (INR) Clear (CLR)

Connects registers and memory Common Bus Connects registers and memory Specific output selected by S2, S1 and S0. When register has length < 16 bits, high-order bus bits are set to 0. Register with LD enabled reads data from bus. When S2SlS0 = 111 Memory with Write enabled reads bus. Memory with Read enabled puts data on bus.

Address Register (AR) Always used to specify address within memory unit. Dedicated register eliminates need for separate address bus. Content of any register output connected to the bus can be written to memory. Any register input connected to bus can be target of memory read. As long as its LD is enabled.

Accumulator (AC) Input comes from adder and logic circuit Adder and logic circuit Input 16-bit output of AC 16-bit data register (DR) 8-bit input register (INPR) Output 16-bit input of AC E flip-flop (extended AC bit. aka overflow) DR and AC input used for arithmetic and logic microoperations

COMMON BUS SYSTEM Registers AR PC DR AC INPR IR TR OUTR S2 S1 Bus S0 Memory unit 7 4096 x 16 Address Write Read AR 1 LD INR CLR PC 2 LD INR CLR DR 3 LD INR CLR E Adder and logic AC 4 LD INR CLR INPR IR 5 LD TR 6 LD INR CLR OUTR Clock LD 16-bit common bus

Question

Question

Question

COMPUTER(BC) INSTRUCTIONS Basic Computer Instruction code format Memory-Reference Instructions (OP-code = 000 ~ 110) 15 14 12 11 I Opcode Address Register-Reference Instructions (OP-code = 111, I = 0) 15 12 11 Register operation 0 1 1 1 Input-Output Instructions (OP-code =111, I = 1) 15 12 11 I/O operation 1 1 1 1

BASIC COMPUTER INSTRUCTIONS Hex Code Symbol I = 0 I = 1 Description AND 0xxx 8xxx AND memory word to AC ADD 1xxx 9xxx Add memory word to AC LDA 2xxx Axxx Load AC from memory STA 3xxx Bxxx Store content of AC into memory BUN 4xxx Cxxx Branch unconditionally BSA 5xxx Dxxx Branch and save return address ISZ 6xxx Exxx Increment and skip if zero CLA 7800 Clear AC CLE 7400 Clear E CMA 7200 Complement AC CME 7100 Complement E CIR 7080 Circulate right AC and E CIL 7040 Circulate left AC and E INC 7020 Increment AC SPA 7010 Skip next instr. if AC is positive SNA 7008 Skip next instr. if AC is negative SZA 7004 Skip next instr. if AC is zero SZE 7002 Skip next instr. if E is zero HLT 7001 Halt computer INP F800 Input character to AC OUT F400 Output character from AC

Question

INSTRUCTION SET COMPLETENESS A computer should have a set of instructions so that the user can construct machine language programs to evaluate any function that is known to be computable. Instruction Types Functional Instructions - Arithmetic, logic, and shift instructions - ADD, CMA, INC, CIR, CIL, AND, CLA Transfer Instructions - Data transfers between the main memory and the processor registers - LDA, STA Control Instructions - Program sequencing and control - BUN, BSA, ISZ Input/Output Instructions - Input and output - INP, OUT

TIMING AND CONTROL Control unit of basic computer Instruction register (IR) 15 14 13 12 11 - 0 Other inputs 3 x 8 decoder 7 6 5 4 3 2 1 0 D I D Control 7 Control outputs logic gates T 15 T 15 14 . . . . 2 1 0 4 x 16 decoder 4-bit Increment (INR) sequence Clear (CLR) counter (SC) Clock Control unit implementation Hardwired Implementation Microprogrammed Implementation

• Fetch instruction from memory • Decode the instruction Instruction Cycle INSTRUCTION CYCLE • Fetch instruction from memory • Decode the instruction • Read effective address from memory if indirect address • Execute the instruction Common bus

Fetch And Decode se cleared to 0, generating timing signal To After each clock pulse, se is incremented Fetch and decode microoperations

DETERMINE THE TYPE OF INSTRUCTION Instrction Cycle DETERMINE THE TYPE OF INSTRUCTION Start SC  0 T0 AR  PC T1 IR  M[AR], PC  PC + 1 T2 Decode Opcode in IR(12-14), AR  IR(0-11), I  IR(15) (Register or I/O) = 1 = 0 (Memory-reference) D7 (I/O) = 1 = 0 (register) (indirect) = 1 = 0 (direct) I I T3 T3 T3 T3 Execute Execute AR  M[AR] Nothing input-output register-reference instruction instruction SC  SC  Execute T4 memory-reference instruction SC  D'7IT3: AR M[AR] D'7I'T3: Nothing D7I'T3: Execute a register-reference instr. D7IT3: Execute an input-output instr.

REGISTER REFERENCE INSTRUCTIONS Instruction Cycle REGISTER REFERENCE INSTRUCTIONS Register Reference Instructions are identified when - D7 = 1, I = 0 - Register Ref. Instr. is specified in b0 ~ b11 of IR - Execution starts with timing signal T3 r = D7 I’ T3 => Register Reference Instruction Bi = IR(i) , i=0,1,2,...,11 r: SC  0 CLA rB11: AC  0 CLE rB10: E  0 CMA rB9: AC  AC’ CME rB8: E  E’ CIR rB7: AC  shr AC, AC(15)  E, E  AC(0) CIL rB6: AC  shl AC, AC(0)  E, E  AC(15) INC rB5: AC  AC + 1 SPA rB4: if (AC(15) = 0) then (PC  PC+1) SNA rB3: if (AC(15) = 1) then (PC  PC+1) SZA rB2: if (AC = 0) then (PC  PC+1) SZE rB1: if (E = 0) then (PC  PC+1) HLT rB0: S  0 (S is a start-stop flip-flop)

MEMORY REFERENCE INSTRUCTIONS MR Instructions MEMORY REFERENCE INSTRUCTIONS Operation Decoder Symbol Symbolic Description AND D0 AC  AC  M[AR] ADD D1 AC  AC + M[AR], E  Cout LDA D2 AC  M[AR] STA D3 M[AR]  AC BUN D4 PC  AR BSA D5 M[AR]  PC, PC  AR + 1 ISZ D6 M[AR]  M[AR] + 1, if M[AR] + 1 = 0 then PC  PC+1 - The effective address of the instruction is in AR and was placed there during timing signal T2 when I = 0, or during timing signal T3 when I = 1 - Memory cycle is assumed to be short enough to complete in a CPU cycle - The execution of MR Instruction starts with T4 AND to AC D0T4: DR  M[AR] Read operand D0T5: AC  AC  DR, SC  0 AND with AC ADD to AC D1T4: DR  M[AR] Read operand D1T5: AC  AC + DR, E  Cout, SC  0 Add to AC and store carry in E

MEMORY REFERENCE INSTRUCTIONS LDA: Load to AC D2T4: DR  M[AR] D2T5: AC  DR, SC  0 STA: Store AC D3T4: M[AR]  AC, SC  0 BUN: Branch Unconditionally D4T4: PC  AR, SC  0 BSA: Branch and Save Return Address M[AR]  PC, PC  AR + 1 Memory, PC, AR at time T4 Memory, PC after execution 20 BSA 135 20 BSA 135 PC = 21 Next instruction 21 Next instruction AR = 135 135 21 136 Subroutine PC = 136 Subroutine 1 BUN 135 1 BUN 135 Memory Memory

MEMORY REFERENCE INSTRUCTIONS MR Instructions MEMORY REFERENCE INSTRUCTIONS BSA: D5T4: M[AR]  PC, AR  AR + 1 D5T5: PC  AR, SC  0 ISZ: Increment and Skip-if-Zero D6T4: DR  M[AR] D6T5: DR  DR + 1 D6T4: M[AR]  DR, if (DR = 0) then (PC  PC + 1), SC  0

FLOWCHART FOR MEMORY REFERENCE INSTRUCTIONS MR Instructions FLOWCHART FOR MEMORY REFERENCE INSTRUCTIONS Memory-reference instruction AND ADD LDA STA D T D T D T D T 4 1 4 2 4 3 4 M[AR] <- AC DR <- M[AR] DR <- M[AR] DR <- M[AR] SC <- 0 D T D T D T 5 1 5 2 5 AC <- AC DR  AC <- AC + DR AC <- DR SC <- 0 E <- Cout SC <- 0 SC <- 0 BUN BSA ISZ D T D T D T 4 4 5 4 6 4 PC <- AR M[AR] <- PC DR <- M[AR] SC <- 0 AR <- AR + 1 D T 5 5 D T 6 5 PC <- AR DR <- DR + 1 SC <- 0 D T 6 6 M[AR] <- DR If (DR = 0) then (PC <- PC + 1) SC <- 0

Question

Question

Question