Overview Part 1 – Datapaths Part 2 – A Simple Computer

Slides:



Advertisements
Similar presentations
9-6 The Control Word Fig The selection variables for the datapath control the microoperations executed within datapath for any given clock pulse.
Advertisements

Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 7 – Registers.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Verilog Part 2 – Chapter.
Instructor: Yuzhuang Hu The Shifter 3 clock cycles will be needed if using a bidirectional shift register with parallel load.  A clock.
Henry Hexmoor.
1 COMP541 Sequencing – III (Sequencing a Computer) Montek Singh April 9, 2007.
Henry Hexmoor1 Chapter 10- Control units We introduced the basic structure of a control unit, and translated assembly instructions into a binary representation.
CPEN Digital System Design Chapter 9 – Computer Design
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 10 – Computer.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Logic and Computer Design.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Computer Design Basics
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Logic and Computer Design.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 9 – Computer Design Basics Part 2 – A Simple.
EKT221 ELECTRONICS DIGITAL II CHAPTER 4: Computer Design Basics
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
A Simple Computer Architecture Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Instructor: Yuzhuang Hu Midterm The midterm is schedule on June 17 th, 17:30-19:30 pm. It covers the following:  VHDL Programming. 
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 10 – Computer.
Multiple-Cycle Hardwired Control Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 7 – Registers and Register Transfers Part.
CoE3DJ4 Digital Systems Design
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Verilog Part 3 – Chapter.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Logic and Computer Design.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
EKT 221 : Chapter 4 Computer Design Basics
Lecture 15: Pipelined Datapath Soon Tee Teoh CS 147.
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use ECE/CS 352: Digital Systems.
Overview Part 1 - Implementation Technology and Logic Design
Overview Memory definitions Random Access Memory (RAM)
CS161 – Design and Architecture of Computer Systems
Electrical and Computer Engineering University of Cyprus
Lecture 3 – Binary Arithmetic
Control Unit Lecture 6.
Chap 7. Register Transfers and Datapaths
/ Computer Architecture and Design
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Computer Science 210 Computer Organization
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
CS/COE0447 Computer Organization & Assembly Language
Basic Processing Unit Unit- 7 Engineered for Tomorrow CSE, MVJCE.
Computer Science 210 Computer Organization
Single-Cycle CPU DataPath.
Overview Part 1 – Datapaths Part 2 – A Simple Computer Introduction
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Lecture 26 – Hardwired and Microprogrammed Control
Topic 5: Processor Architecture
Unit 12 CPU Design & Programming
Overview Part 1 - Registers, Microoperations and Implementations
CSC 220: Computer Organization
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Data manipulation instructions
Branch instructions We’ll implement branch instructions for the eight different conditions shown here. Bits 11-9 of the opcode field will indicate the.
8-6 The Control Word The selection variables for the datapath control the microoperations executed within datapath for any given clock pulse Fig
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
ECE 352 Digital System Fundamentals
ECE 352 Digital System Fundamentals
Review: The whole processor
CS/COE0447 Computer Organization & Assembly Language
The Processor: Datapath & Control.
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Overview Part 1 – Datapaths Part 2 – A Simple Computer Introduction Datapath Example Arithmetic Logic Unit (ALU) Shifter Datapath Representation and Control Word Part 2 – A Simple Computer Instruction Set Architecture (ISA) Single-Cycle Hardwired Control PC Function Instruction Decoder Example Instruction Execution Part 3 – Multiple Cycle Hardwired Control Single Cycle Computer Issues Sequential Control Design

Instruction Set Architecture (ISA) for Simple Computer (SC) A programmable system uses a sequence of instructions to control its operation An typical instruction specifies: Operation to be performed Operands to use, and Where to place the result, or Which instruction to execute next Instructions are stored in RAM or ROM as a program The addresses for instructions in a computer are provided by a program counter (PC) that can Count up Load a new address based on an instruction and, optionally, status information

Instruction Set Architecture (ISA) (continued) The PC and associated control logic are part of the Control Unit Executing an instruction - activating the necessary sequence of operations specified by the instruction Execution is controlled by the control unit and performed: In the datapath In the control unit In external hardware such as memory or input/output

ISA: Storage Resources The storage resources are "visible" to the programmer at the lowest software level (typically, machine or assembly language) Storage resources for the SC => Separate instruction and data memories imply "Harvard architecture" Done to permit use of single clock cycle per instruction implementation Due to use of "cache" in modern computer architectures, is a fairly realistic model Program counter (PC) Instruction memory 2 15 x 16 Register file x 8 16 Data memory 2 15 x 16

ISA: Instruction Format A instruction consists of a bit vector The fields of an instruction are subvectors representing specific functions and having specific binary codes defined The format of an instruction defines the subvectors and their function An ISA usually contains multiple formats The SC ISA contains the three formats presented on the next slide

ISA: Instruction Format (c) Jump and Branch (a) Register Opcode Destination register (DR) Source reg- ister A (SA) ister B (SB) 15 9 8 6 5 3 2 (b) Immediate Operand (OP) Address (AD) (Right) (Left) The three formats are: Register, Immediate, and Jump and Branch All formats contain an Opcode field in bits 9 through 15. The Opcode specifies the operation to be performed More details on each format are provided on the next three slides

ISA: Instruction Format (continued) (a) Register Opcode Destination register (DR) Source reg- ister A (SA) ister B (SB) 15 9 8 6 5 3 2 This format supports instructions represented by: R1 ← R2 + R3 R1 ← sl R2 There are three 3-bit register fields: DR - specifies destination register (R1 in the examples) SA - specifies the A source register (R2 in the first example) SB - specifies the B source register (R3 in the first example and R2 in the second example) Why is R2 in the second example SB instead of SA? The source for the shifter in our datapath to be used in implementation is Bus B rather than Bus A

ISA: Instruction Format (continued) (b) Immediate Opcode Destination register (DR) Source reg- ister A (SA) 15 9 8 6 5 3 2 Operand (OP) This format supports instructions described by: R1 ← R2 + 3 The B Source Register field is replaced by an Operand field OP which specifies a constant. The Operand: 3-bit constant Values from 0 to 7 The constant: Zero-fill (on the left of) the Operand to form 16-bit constant 16-bit representation for values 0 through 7

ISA: Instruction Format (continued) (c) Jump and Branch Opcode Source reg- ister A (SA) 15 9 8 6 5 3 2 Address (AD) (Right) (Left) This instruction supports changes in the sequence of instruction execution by adding an extended, 6-bit, signed 2s-complement address offset to the PC value The 6-bit Address (AD) field replaces the DR and SB fields Example: Suppose that a jump is specified by the Opcode and the PC contains 45 (0…0101101) and Address contains – 12 (110100). Then the new PC value will be: 0…0101101 + (1…110100) = 0…0100001 (45 + (– 12) = 33) The SA field is retained to permit jumps and branches on N or Z based on the contents of Source register A

ISA: Instruction Specifications The specifications provide: The name of the instruction The instruction's opcode A shorthand name for the opcode called a mnemonic A specification for the instruction format A register transfer description of the instruction, and A listing of the status bits that are meaningful during an instruction's execution (not used in the architectures defined in this chapter)

ISA: Instruction Specifications (continued) fications for the Simple Comput er - Part 1 Instr u ctio O pc ode Mnem on ic Form a t D escrip tion St s Bits Move A 0000000 MO V A RD ,RA R [DR] ¬ R[SA ] N , Z Increment 0000001 INC RA R[DR] [ SA] + 1 Add 0000010 ADD RA,RB + R[ SB] Subtr ct 0000101 SUB - e crement 0000110 DEC 1 AND 0001000 Ù R[SB , Z 0001001 OR ,RA,RB Ú Exclusive OR 0001010 XOR Å R[SB] NO T 0001011 N,

ISA: Instruction Specifications (continued) fications for the Simple Comput er - Part 2 Instr u ctio O pc ode Mnem on ic Form a t D escrip tion St s Bits Move B 0001100 MO VB RD ,RB R [DR] ¬ R[SB] Shift Right 0001101 SHR , RB R[DR] sr Shift Left 0001110 SHL sl Load Imm e diate 1001100 LDI P zf OP Add Immediate 1000010 ADI RA,OP R[SA] + zf OP Load 0010000 LD ,RA M[ SA ] Store 0100000 ST RA,RB M [SA] Branch Zero 1100000 BRZ A,AD if (R[ S A] = 0) PC PC + s A Negative 1100001 BRN A] < J mp 1110000 JMP C R[SA

ISA:Example Instructions and Data in Memory Memory Repr esentation of Instruc t ions and Data D eciimal Ad d r ess Mem o y C ontents Dec i mal Op cod e Other F elds eration 25 00001 01 001 010 011 5 (Subtract) DR:1, SA:2, SB:3 R1 ¬ R2 - R3 35 01000 00 000 100 101 32 (Store ) S A:4, SB:5 M[ R4] R5 45 10000 10 010 111 66 (Add Im mediate) DR: 2 , S A : 7 , OP :3 R R7 + 3 55 11000 00 101 110 96 (Branch on Z ro AD: 44, SA:6 If R6 = 0, PC 20 70 000 000000110 00000 Data = 1 92. Aft r execution of instruction in 35, 8 .

Single-Cycle Hardwired Control Based on the ISA defined, design a computer architecture to support the ISA The architecture is to fetch and execute each instruction in a single clock cycle The datapath from Figure 10-11 will be used The control unit will be defined as a part of the design The block diagram is shown on the next slide

Chapter 10 Part 2 16 IR(8:6) || IR(2:0) Extend V C Branch PC N Control Z P J B Address L B C Instruction memory RW D Instruction DA Register file AA A B BA Zero fill IR(2:0) Constant in Instruction decoder 1 MB MUX B Address out Bus A Bus B Data out MW D B A M F M R M P J B A A A B S D W W L B C A B Data in Address FS CONTROL V Data Function C memory unit N Data out Z F Data in 1 MD MUX D Bus D DATAPATH Chapter 10 Part 2 16

The Control Unit The Data Memory has been attached to the Address Out and Data Out and Data In lines of the Datapath. The MW input to the Data Memory is the Memory Write signal from the Control Unit. For convenience, the Instruction Memory, which is not usually a part of the Control Unit is shown within it. The Instruction Memory address input is provided by the PC and its instruction output feeds the Instruction Decoder. Zero-filled IR(2:0) becomes Constant In Extended IR(8:6) || IR(2:0) and Bus A are address inputs to the PC. The PC is controlled by Branch Control logic

PC Function PC function is based on instruction specifications involving jumps and branches taken from Slide 13: In addition to the above register transfers, the PC must also implement: PC ← PC + 1 The first two transfers above require addition to the PC of: Address Offset = Extended IR(8:6) || IR(2:0) The third transfer requires that the PC be loaded with: Jump Address = Bus A = R[SA] The counting function of the PC requires addition to the PC of 1 ← Branch on Zero BRZ if (R[ S A] = 0) PC PC + s e A D Branch on Negative BRN if (R[ S A] < 0) PC ← PC + s e A D J u mp JMP P C ← R[SA ]

PC Function (continued) Branch Control determines the PC transfers based on five of its inputs defined as follows: N,Z – negative and zero status bits PL – load enable for the PC JB – Jump/Branch select: If JB = 1, Jump, else Branch BC – Branch Condition select: If BC = 1, branch for N = 1, else branch for Z = 1. The above is summarize by the following table: Sufficient information is provided here to design the PC PC Operation PL JB BC Count Up X Jump 1 Branch on Negative (else Count Up) Branch on Zero (else Count Up)

Instruction Decoder The combinational instruction decoder converts the instruction into the signals necessary to control all parts of the computer during the single cycle execution The input is the 16-bit Instruction The outputs are control signals: Register file addresses DA, AA, and BA, Function Unit Select FS Multiplexer Select Controls MB and MD, Register file and Data Memory Write Controls RW and MW, and PC Controls PL, JB, and BC The register file outputs are simply pass-through signals: DA = DR, AA = SA, and BA = SB Determination of the remaining signals is more complex.

Instruction Decoder (continued) The remaining control signals do not depend on the addresses, so must be a function of IR(13:9) Formulation requires examining relationships between the outputs and the opcodes given in Slides 12 and 13. Observe that for other than branches and jumps, FS = IR(12:9) This implies that the other control signals should depend as much as possible on IR(15:13) (which actually were assigned with decoding in mind!) To make some sense of this, we divide instructions into types as shown in the table on the next page

Instruction Decoder (continued) ruth a ble for Instruction Decoder Logic Instruction Function ype Instruction Bits Contr ol W o r d Bits 15 14 13 9 M B D R P L J C Function unit operations using registers 0 0 0 X 0 0 1 0 X X Memory read 1 0 1 1 0 Memory write 0 1 register and constant 1 0 0 1 0 1 0 Conditional branch on zero (Z) 0 X 0 1 0 0 Conditional branch on negative (N) X X 0 1 0 1 Unconditional J ump X X 0 1 1

Instruction Decoder (continued) The types are based on the blocks controlled and the seven signals to be generated; types can be divided into two groups: Datapath and Memory Control (First 4 types) PC Control (Last 3 types) In Datapath and Memory Control blocks controlled are considered: Mux B (1st and 4th types) Memory and Mux D (2nd and 3rd types) By assigning codes with no or only one 1 for these, implementation of MB, MD, RW and MW are simplified. In Control Unit more of a bit setting approach was used: Bit 15 = Bit 14 = 1 were assigned to generate PL Bit 13 values were assigned to generate JB. Bit 9 was use as BC which contradicts FS = 0000 needed for branches. To force FS(6) to 0 for branches, Bit 9 into FS(6) is disabled by PL. Also, useful bit correlations between values in the two groups were exploited in assigning the codes.

Instruction Decoder (continued) The end result by use of the types, careful assignment of codes, and use of don't cares, yields very simple logic: This completes the design of most of the essential parts of the single-cycle simple computer 19 – 17 DA 16 14 AA 13 11 BA 10 MB 9 6 FS 5 MD 4 RW 3 MW 2 PL 1 JB BC Instruction Opcode DR SA SB Control word 15 12 8

Example Instruction Execution Decoding, control inputs and paths shown for ADI, RD and BRZ on next 6 slides [ ] [ ] Six Instructio ns for the Sin g le-Cycle Comp uter Operation co de Symb ol ic na m e Fo rm a t D s c r ip ti on Fu nc MB MD R W MW PL J B BC 1000 010 ADI I mme diate A dd immediate operand 1 0 0 0 0 0010 000 LD Register Load mem o ry ont n t in to reg i er 0 0 1 0 0100 ST Store re gister onten memory 1 0 0 0 0001 110 SL Shift left 011 NO T egister Comple ment 0 0 0 1 1100 BRZ ump/Branch If [SA] = 0, branch to PC + se AD If R[ SA] = 0, , If R[S ] ¹ 0, 0 1 0 0 DR [ ] SA zf (2:0) + ¬ M R M R SB sl PC P C se AD

Decoding for ADI 1 0 0 0 0 1 0 0 0 1 0 19 – 17 DA 16 14 AA 13 11 BA 10 MB 9 6 FS 5 MD 4 RW 3 MW 2 PL 1 JB BC Instruction Opcode DR SA SB Control word 15 12 8 1 0 0 0 0 1 0 0 0 1 0

+ Control Inputs and Paths for ADI Increment PC No Write 0 0 1 0 Bus A Bus B Address out Data out MW Data in MUX B 1 MUX D DATAPATH RW DA AA Constant in BA MB FS V C N Z Function unit A B F MD Bus D IR(2:0) Address Data memory Register file D Instruction Zero fill S M R W Instruction decoder J Extend L P Branch Control IR(8:6) || IR(2:0) PC CONTROL Control Inputs and Paths for ADI 0 0 1 0 + No Write Increment PC

Decoding for LD 0 0 1 0 0 0 0 0 0 0 0 19 – 17 DA 16 14 AA 13 11 BA 10 MB 9 6 FS 5 MD 4 RW 3 MW 2 PL 1 JB BC Instruction Opcode DR SA SB Control word 15 12 8 0 0 1 0 0 0 0 0 0 0 0

Control Inputs and Paths for LD Bus A Bus B Address out Data out MW Data in MUX B 1 MUX D DATAPATH RW DA AA Constant in BA MB FS V C N Z Function unit A B F MD Bus D IR(2:0) Address Data memory Register file D Instruction Zero fill S M R W Instruction decoder J Extend L P Branch Control IR(8:6) || IR(2:0) PC CONTROL Control Inputs and Paths for LD 0 0 0 0 No Write Increment PC

Decoding for BRZ 1 1 0 0 0 0 0 0 0 0 0 19 – 17 DA 16 14 AA 13 11 BA 10 MB 9 6 FS 5 MD 4 RW 3 MW 2 PL 1 JB BC Instruction Opcode DR SA SB Control word 15 12 8 1 1 0 0 0 0 0 0 0 0 0

Control Inputs and Paths for BRZ Bus A Bus B Address out Data out MW Data in MUX B 1 MUX D DATAPATH RW DA AA Constant in BA MB FS V C N Z Function unit A B F MD Bus D IR(2:0) Address Data memory Register file D Instruction Zero fill S M R W Instruction decoder J Extend L P Branch Control IR(8:6) || IR(2:0) PC CONTROL Control Inputs and Paths for BRZ 0 0 0 0 No Write Branch on

Terms of Use © 2004 by Pearson Education,Inc. All rights reserved. The following terms of use apply in addition to the standard Pearson Education Legal Notice. Permission is given to incorporate these materials into classroom presentations and handouts only to instructors adopting Logic and Computer Design Fundamentals as the course text. Permission is granted to the instructors adopting the book to post these materials on a protected website or protected ftp site in original or modified form. All other website or ftp postings, including those offering the materials for a fee, are prohibited. You may not remove or in any way alter this Terms of Use notice or any trademark, copyright, or other proprietary notice, including the copyright watermark on each slide. Return to Title Page

This Summary is an Online Content from this Book: Morris Mano, DIGITAL DESIGN, 4th Edition, Prentice Hall, 2007 It is edited for Logic Analysis and Design Course 6803213-3 by: T.Mariah Sami Khayat Teacher Assistant @ Adam University College For Contacting: mskhayat@uqu.edu.sa Kingdom of Saudi Arabia Ministry of Education Umm AlQura University Adam University College Computer Science Department المملكة العربية السعودية وزارة التعليم جامعة أم القرى الكلية الجامعية أضم قسم الحاسب الآلي