Chapter 9 Computer Design Basics

Similar documents
Chapter 9 Computer Design Basics

Fig. 7-6 Single Bus versus Dedicated Multiplexers

Load. Load. Load 1 0 MUX B. MB select. Bus A. A B n H select S 2:0 C S. G select 4 V C N Z. unit (ALU) G. Zero Detect.

EE260: Digital Design, Spring n MUX Gate n Rudimentary functions n Binary Decoders. n Binary Encoders n Priority Encoders

Generic datapath. Generic datapath architecture. Register file. Register file. Calcolatori Elettronici e Sistemi Operativi.

EE260: Digital Design, Spring n Binary Addition. n Complement forms. n Subtraction. n Multiplication. n Inputs: A 0, B 0. n Boolean equations:

CHAPTER XI DATAPATH ELEMENTS

Design of Sequential Circuits

Arithmetic Circuits. (Part I) Randy H. Katz University of California, Berkeley. Spring 2007

Annotations to the assignments and the solution sheet. Note the following points

Arithmetic Circuits. (Part I) Randy H. Katz University of California, Berkeley. Spring Time vs. Space Trade-offs. Arithmetic Logic Units

Applications of Distributed Arithmetic to Digital Signal Processing: A Tutorial Review

We start by describing a one bit memory circuit built of a couple of two inputs NAND gates.

Structure of a Typical Digital System Data Inputs

Overview EECS Components and Design Techniques for Digital Systems. Lec 15 Addition, Subtraction, and Negative Numbers. Positional Notation

Internal Information Representation and Processing

Design at the Register Transfer Level

CS61C : Machine Structures

CHAPTER log 2 64 = 6 lines/mux or decoder 9-2.* C = C 8 V = C 8 C * 9-4.* (Errata: Delete 1 after problem number) 9-5.

CS61C : Machine Structures

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

Problem Set # 5 Solutions

ECE 308 Discrete-Time Signals and Systems

CMOS. Dynamic Logic Circuits. Chapter 9. Digital Integrated Circuits Analysis and Design

Problem 01 X Y. Logic Testbank. Problem. Problems. Problem 1:

DESCRIPTION OF THE SYSTEM

7. Modern Techniques. Data Encryption Standard (DES)

ITEC 360 Data Structures and Analysis of Algorithms Spring for n 1

Design of Digital Circuits Lecture 7: Sequential Logic Design. Prof. Onur Mutlu ETH Zurich Spring March 2018

Combinational & Sequential Logic

DESIGN AND IMPLEMENTATION OF IMPROVED AREA EFFICIENT WEIGHTED MODULO 2N+1 ADDER DESIGN

U8L1: Sec Equations of Lines in R 2

Principle Of Superposition

EE260: Digital Design, Spring n Binary logic and Gates n Boolean Algebra. n Basic Properties n Algebraic Manipulation

6.111 Lecture 6 Today: 1.Blocking vs. non-blocking assignments 2.Single clock synchronous circuits 3.Finite State Machines

課程名稱 : 數位邏輯設計 P-1/ /6/11

ECE-S352 Introduction to Digital Signal Processing Lecture 3A Direct Solution of Difference Equations

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

(3) If you replace row i of A by its sum with a multiple of another row, then the determinant is unchanged! Expand across the i th row:

CprE 281: Digital Logic

Classification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)

CPS 104 Computer Organization and Programming Lecture 11: Gates, Buses, Latches. Robert Wagner

Module 5 EMBEDDED WAVELET CODING. Version 2 ECE IIT, Kharagpur

9. Datapath Design. Jacob Abraham. Department of Electrical and Computer Engineering The University of Texas at Austin VLSI Design Fall 2017

Enrico Nardelli Logic Circuits and Computer Architecture

Advanced Course of Algorithm Design and Analysis

ALU A functional unit

Run-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE

C/CS/Phys C191 Deutsch and Deutsch-Josza algorithms 10/20/07 Fall 2007 Lecture 17

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Linear time invariant systems

Fundamentals of Digital Design

Cooperative Communication Fundamentals & Coding Techniques

EE 505. Lecture 29. ADC Design. Oversampled

SCALING OF NUMBERS IN RESIDUE ARITHMETIC WITH THE FLEXIBLE SELECTION OF SCALING FACTOR

CMP 334: Seventh Class

Discrete-Time Systems, LTI Systems, and Discrete-Time Convolution

Numerical Methods in Fourier Series Applications

Decoding A Counter. svbitec.wordpress.com 1

Properties and Tests of Zeros of Polynomial Functions

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

Sample Test Paper - I

Applications of Distributed Arithmetic to Digital Signal Processing: A Tutorial Review

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Number Representation

Quantum Information & Quantum Computation

CHAPTER 10 INFINITE SEQUENCES AND SERIES

Finite-length Discrete Transforms. Chapter 5, Sections

Computer Engineering Department. CC 311- Computer Architecture. Chapter 4. The Processor: Datapath and Control. Single Cycle

U8L1: Sec Equations of Lines in R 2

Computing the output response of LTI Systems.

Lecture 3. Digital Signal Processing. Chapter 3. z-transforms. Mikael Swartling Nedelko Grbic Bengt Mandersson. rev. 2016

Computability and computational complexity

Olli Simula T / Chapter 1 3. Olli Simula T / Chapter 1 5

1. Linearization of a nonlinear system given in the form of a system of ordinary differential equations

2C09 Design for seismic and climate changes

Merge and Quick Sort

Digital Logic and Design (Course Code: EE222) Lecture 0 3: Digital Electronics Fundamentals

A widely used display of protein shapes is based on the coordinates of the alpha carbons - - C α

CS161: Algorithm Design and Analysis Handout #10 Stanford University Wednesday, 10 February 2016

Processor Design & ALU Design

Chapter 4 : Laplace Transform

In algebra one spends much time finding common denominators and thus simplifying rational expressions. For example:

Proof of Goldbach s Conjecture. Reza Javaherdashti

Menu. 7-Segment LED. Misc. 7-Segment LED MSI Components >MUX >Adders Memory Devices >D-FF, RAM, ROM Computer/Microprocessor >GCPU

CMPEN 411 VLSI Digital Circuits Spring Lecture 21: Shifters, Decoders, Muxes

Parallel Vector Algorithms David A. Padua

Lesson 10: Limits and Continuity

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.

Model of Computation and Runtime Analysis

Number Conversion. Roland Backhouse March 5, 2001

Quantum Computing Lecture 7. Quantum Factoring

CS151 Complexity Theory

MATH 262A LECTURE 1: AN INTRODUCTION TO BOOLEAN CIRCUITS AND FORMULAE

BHW #13 1/ Cooper. ENGR 323 Probabilistic Analysis Beautiful Homework # 13

Time-Domain Representations of LTI Systems

Exponents. Learning Objectives. Pre-Activity

Unit 7 Sequential Circuits (Flip Flop, Registers)

Transcription:

Logic ad Computer Desig Fudametals Chapter 9 Computer Desig Basics Part 1 Datapaths

Overview Part 1 Datapaths Itroductio Datapath Example Arithmetic Logic Uit (ALU) Shifter Datapath Represetatio Cotrol Word Part 2 A Simple Computer Istructio Set Architecture (ISA) Sigle-Cycle Hardwired Cotrol Istructio Decoder Sample Istructios Sigle Cycle Computer Issues 2

Itroductio Computer Specificatio Istructio Set Architecture (ISA) - the specificatio of a computer's appearace to a programmer at its lowest level. Computer Architecture - a high-level descriptio of the hardware implemetig the computer derived from the ISA + additioal specificatios such as speed, cost, ad reliability. 3

Itroductio (cotiued) Simple computer architecture decomposed ito: Datapath for performig operatios. Cotrol uit for cotrollig datapath operatios. 4

Datapath ad Cotrol Datapath - performs data trasfer ad processig operatios. Cotrol Uit - Determies the eablig ad sequecig of the operatios. Cotrol iputs Cotrol uit The cotrol uit receives: Exteral cotrol iputs Status sigals Cotrol sigals Status sigals Cotrol outputs Data iputs Datapath The cotrol uit seds: Cotrol sigals Cotrol outputs Describe properties of the state of the datapath Data outputs 5

A datapath is specified by: A set of registers. The microoperatios performed o the data stored i the registers. A cotrol iterface: sigals comig ito datapath. 6

Datapaths Guidig priciples for basic datapaths: The set of registers Collectio of idividual registers. A set of registers with commo access resources called a register file. A combiatio of the above. Microoperatio implemetatio Oe or more shared resources for implemetig microoperatios: Buses - shared trasfer paths. Arithmetic-Logic Uit (ALU) - shared resource for implemetig arithmetic ad logic microoperatios. Shifter - shared resource for implemetig shift microoperatios. 7

Datapath Example Four parallel-load registers. Two mux-based register selectors. Register destiatio decoder. Mux B for exteral costat iput. Buses A ad B with exteral address ad data outputs. ALU ad Shifter with Mux F for output select. Mux D for exteral data iput. Logic for geeratig status bits V, C, N, Z. Write D data Load eable 0 1 2 3 MD select 0 1 MUX D Bus D 8 V C N Z Load Load Load Load G select 4 Zero Detect MF select R0 R1 R2 R3 Decoder D address 2 Costat i Destiatio select MB select Bus A 1 0 MUX B 0 1 MUX F F Bus B 2 2 A data A B H select A B 2 B S 2:0 C i Arithmetic/logic uit (ALU) G A address A select 0 1 MUX 2 3 Fuctio uit Register file S 0 I R Shifter I L 0 H B select B address 0 1 MUX 2 3 B data Address Out Data Out Data I

Datapath Example: Performig a Microoperatio Microoperatio: R0 R1 + R2 Apply 01 to A select to place cotets of R1 oto Bus A. Apply 10 to B select to place cotets of R2 oto B data ad apply 0 to MB select to place B data o Bus B. Apply 0010 to G select to perform additio G = Bus A + Bus B Apply 0 to MF select ad 0 to MD select to place the value of G oto BUS D. Apply 00 to Destiatio select to eable the Load iput to R0. Apply 1 to Load Eable to force the Load iput to R0 to 1 so that R0 is loaded o the clock pulse (ot show) The overall microoperatio requires 1 clock cycle. Write D data Load eable 0 1 2 3 MD select 0 1 MUX D Bus D 9 V C N Z Load Load Load Load G select 4 Zero Detect MF select R0 R1 R2 R3 Decoder D address 2 Costat i Destiatio select MB select Bus A 1 0 MUX B 0 1 MUX F F Bus B 2 2 A data A B H select A B 2 B S 2:0 C i Arithmetic/logic uit (ALU) G A address A select 0 1 MUX 2 3 Fuctio uit Register file S 0 I R Shifter I L 0 H B select B address 0 1 MUX 2 3 B data Address Out Data Out Data I

Datapath Example: Key Cotrol Actios for Microoperatio Alteratives Perform a shift microoperatio apply 1 to MF select Use a costat i a microoperatio usig Bus B apply 1 to MB select Provide a address ad data for a memory or output write microoperatio apply 0 to Load eable to prevet register loadig Provide a address ad obtai data for a memory or output read microoperatio apply 1 to MD select For some of the above, other cotrol sigals become do't cares Write D data Load eable 0 1 2 3 MD select 0 1 MUX D Bus D 10 V C N Z Load Load Load Load G select 4 Zero Detect MF select R0 R1 R2 R3 Decoder D address 2 Costat i Destiatio select MB select Bus A 1 0 MUX B 0 1 MUX F F Bus B 2 2 A data A B H select A B 2 B S 2:0 C i Arithmetic/logic uit (ALU) G A address A select 0 1 MUX 2 3 Fuctio uit Register file S 0 I R Shifter I L 0 H B select B address 0 1 MUX 2 3 B data Address Out Data Out Data I

Arithmetic Logic Uit (ALU) We ow deal with detailed desig of typical ALUs ad shifters. Decompose the ALU ito: A arithmetic circuit: A -bit parallel adder. A block of logic that selects four choices for the B iput to the adder. A logic circuit: Gates to implemet the basic logic operatios. A selector to select which logic operatio to perform. A selector to pick betwee the two circuits. 11

-Bit ALU Block Diagram Operatio withi arithmetic or logic Arithmetic or Logic 12

ALU 3 steps: 1. Desig arithmetic sectio. 2. Desig logic sectio. 3. Combie both. 13

Arithmetic Circuit Desig There are oly four fuctios of B to select as Y i G = A + Y + C i : Y All 0s B B All 1s C i = 0 G = A G = A + B G = A + B G = A 1 C i = 1 G = A + 1 G = A + B + 1 G = A + B + 1 G = A C i A X B S 0 S 1 B iput logic Y -bit parallel adder G = X 1 + Y Y 1 C + i C i C out 14

Addig selectio codes to the fuctios of B: 15

Parallel Adder We will deal with the desig of ALU bit by bit. 1 bit of ALU = 1 stage of ALU. We desig 1 stage ad repeat it for the rest of the stages. 16

Arithmetic Circuit Desig (cotiued) 1 stage of arithmetic sectio of ALU: 17

1 Stage of Arithmetic Sectio of ALU S 0 S 1 C i A i B i X i Y i G i C i+1 Yi = B i S 0 + B i S 1 18

Arithmetic Sectio of 4-bit ALU 19

Logic Circuit Bitwise operatios: AND, OR, XOR, NOT. Use logic gates ad MUX. Oe stage of Logic circuit: 20

Combiig Arithmetic ad Logic Sectios 1 stage of arithmetic + 1 stage of logic + 2-to-1 MUX = 1 stage of ALU. A ew sigal S 2 performs the arithmetic/logic selectio The select sigal eterig the LSB of the arithmetic circuit, C i, is coected to the least sigificat selectio iput for the logic circuit, S 0. C i C i C i + 1 A i B i S 0 S 1 A i B i S 0 S 1 Oe stage of arithmetic circuit 0 2-to-1 MUX G i A i 1 S C i B i S 0 Oe stage of logic circuit S 1 Chapter 9 Part 1 S 2 IT321 21

Detailed Stage of ALU S 0 S 1 C i A i B i X i Y i C i C i+1 0 2-to-1 MUX G i 1 S S 2 22

Fuctio Table for ALU 23

Shift Operatio Shift right ad shift left. Could be implemeted usig a bidirectioal shift register with parallel load. 1. Load data from Bus to register. 2. Shift. 3. Retur data to Bus. Sequetial. Requires 3 clock pulses. Alterative solutio: use a combiatioal circuit. Use MUXs. Requires 1 clock pulse. 24

Combiatioal Shifter Parameters Directio: Left. Right. Number of positios: Sigle bit. Multiple bits. Fillig of vacat positios: May optios depedig o istructio set. Here, will provide iput lies or zero fill. 25

4-Bit Basic Left/Right Shifter Serial output L B 3 B 2 B 1 B 0 I R Serial output R I L S 0 1 2 M U X S 0 1 2 M U X S 0 1 2 M U X S 0 1 2 M U X S 2 H 3 H 2 H 1 H 0 Serial Iputs (value depeds o shift type): I R for right shift I L for left shift Serial Outputs R for right shift (Same as MSB iput) L for left shift (Same as LSB iput) Shift Fuctios: (S 1, S 0 ) = 00 Pass B uchaged 01 Right shift 10 Left shift 11 Uused 26

Datapath Represetatio 1. The registers, ad the multiplexer, decoder, ad eable hardware for accessig them become a register file. 2. The ALU, shifter, Mux F ad status hardware become a fuctio uit. 3. The remaiig muxes ad buses which hadle data trasfers are at the ew level of the hierarchy. Costat i MB select FS V C N Z m m 4 D data Write D address m 2 x Register file A address A data A Bus A B address B data Fuctio uit F 1 0 MUX B Bus B B m Address out Data out Data i MD select 0 1 MUX D 27

Simplifyig the Data Path Represetatio Write D data Load eable 0 1 2 3 V C N Z Load Load Load Load G select 4 Zero Detect MF select R0 R1 R2 R3 Decoder D address 2 Costat i Destiatio select MB select Bus A 1 0 MUX B 0 1 MUX F F Bus B 2 2 A data A B H select A B 2 B S 2:0 C i Arithmetic/logic uit (ALU) G A address A select 0 1 MUX 2 3 S 0 I R Shifter I L 0 H Fuctio uit B select B address 0 1 MUX 2 3 Register file B data Address Out Data Out Data I Costat i MB select MD select 0 1 MUX D Chapter 9 Part 1 Bus D IT321 28 FS V C N Z m m 4 MD select D data Write D address m 2 x Register file A address A data A Bus A B address B data Fuctio uit F 0 1 MUX D 1 0 MUX B Bus B B m Address out Data out Data i

Datapath Represetatio (cotiued) I the register file: Multiplexer select iputs become A address ad B address. Decoder iput becomes D address. Multiplexer outputs become A data ad B data. Iput data to the registers becomes D data. Load eable becomes write. The register file ow appears like a memory based o clocked flip-flops (the clock is ot show). The fuctio uit labelig is quite straightforward except for FS bits: Defie the cotrol sigals to the fuctio uit: MF (1 bit): ALU or Shifter. G (4 bits): Operatio i ALU: S 2, S 1, S 0, ad C i. H (2 bits): Trasfer, shift left or shift right. Costat i MB select 29 FS V C N Z m m 4 MD select D data Write D address m 2 x Register file A address A data A Bus A B address B data Fuctio uit F 0 1 MUX D 1 0 MUX B Bus B B m Address out Data out Data i

Defiitio of Fuctio Uit Select (FS) Codes G Select, H Select, ad MF i T of FS Codes Boolea Equatios: MF = FS 3 FS 2 G 3 = FS 3 G 2 = FS 2 G 1 = FS 1 G 0 = FS 0 H 1 = FS 1 H 0 = FS 0 30

The Cotrol Word The datapath has may cotrol iputs. The sigals drivig these iputs ca be defied ad orgaized ito a cotrol word. To execute a microistructio, we apply cotrol word values for a clock cycle. Addresses for the data read from register file. Fuctio performed. Addresses for the data writte to register file. Exteral data. 31

The Cotrol Word Fields 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 D A AA BA M B FS M D R W Cotrol word Fields DA D Address AA A Address BA B Address MB Mux B FS Fuctio Select MD Mux D RW Register Write 3 bits each. Meas we have up to 8 registers. 2 d parameter to fuctio from register (0) or a costat (1). Load to register exteral data or result of fuctio. 32

Cotrol Word Block Diagram R W 0 Write D data D A 15 14 13 D address 8 x Register file AA 12 11 10 A address A data B address B data 9 8 7 BA Costat i MB 6 Bus A 1 0 MUX B Bus B Address out Data out A B Cotrol word V C N Z Fuctio uit 5 4 FS 3 2 Data i 0 1 MD 1 MUX D Bus D 33

Cotrol Word Ecodig Ecodig of Cotrol W D A, AA, B A MB FS MD R W Fuctio Code Fuctio Code Fuctio Code Fuctio Code Fuctio Code R 0 000 Register 0 F A 0000 Fuctio 0 No write 0 R 1 001 Costat 1 F A + 1 0001 Data I 1 Write 1 R 2 010 F A + B 0010 R 3 011 F A + B + 1 0011 R 4 100 F A + B 0100 R 5 101 F A + B + 1 0101 R 6 110 F A - 1 0110 R 7 111 F A 0111 F A B 1000 F A B 1001 F A B 1010 F A 1011 F B 1100 F sr B 1101 F sl B 1110 34

Example Microoperatios for the Datapath - Symbolic & Biary Represetatio Micr o- op eratio D A A A B A M B F S M D R W R 1 R 2 R 3 R 4 s l R6 R 7 R 7 + 1 R 1 R 0 + 2 Data out R 3 R 4 D ata i R 5 0 R1 R2 R3 Register F = A + B + 1 Fuctio Write 001 010 011 0 0101 0 1 R 4 R 6 Register F = sl B Fuctio Write 100 xxx 110 0 1110 0 1 R 7 R 7 F = A + 1 Fuctio Write 111 111 xxx x 0001 0 1 R 1 R 0 Costat F = A + B Fuctio Write 001 000 xxx 1 0010 0 1 R 3 Register No Write xxx xxx 011 0 xxxx x 0 R 4 Data i Write 100 xxx xxx x xxxx 1 1 R 5 R 0 R 0 Register F = A B Fuctio Write 101 000 000 0 1010 0 1 35

Biary Represetatio 36