Lecture 10: Computer Design Basics: The ALU and the Shifter Soon Tee Teoh CS 147.

Slides:



Advertisements
Similar presentations
Machine cycle.
Advertisements

Computer Architecture CS 215
Chapter 9 Computer Design Basics. 9-2 Datapaths Reminding A digital system (or a simple computer) contains datapath unit and control unit. Datapath: A.
Speical purpose Encoders/Comparators
Computer Science 210 Computer Organization Clocks and Memory Elements.
CS 140 Lecture 11 Professor CK Cheng 5/09/02. Part III - Standard Modules Decoder, Encoder, Mux, DeMux, Shifter, Adder, Multiplexer Interconnect: Decoder,
1 CS 140 Lecture 14 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego Some slides from Harris and Harris.
Henry Hexmoor.
CS 140 Lecture 13 Combinational Standard Modules Professor CK Cheng CSE Dept. UC San Diego 1.
Overview Part 1 – Datapaths Part 2 – A Simple Computer
1 COMP541 Datapaths II Montek Singh Mar 22, 2007.
Chapter 7. Register Transfer and Computer Operations
IMPLEMENTATION OF µ - PROCESSOR DATA PATH
CS 140 Lecture 12 Professor CK Cheng 11/07/02. Part III - Standard Modules Decoder, Encoder, Mux, DeMux, Shifter, Adder, Multiplexer Interconnect: Decoder,
Combinational Comparators
Homework Reading Machine Projects Labs
CPEN Digital System Design Chapter 9 – Computer Design
Logic and Computer Design Dr. Sanjay P. Ahuja, Ph.D. FIS Distinguished Professor of CIS ( ) School of Computing, UNF.
The Processor Data Path & Control Chapter 5 Part 1 - Introduction and Single Clock Cycle Design N. Guydosh 2/29/04.
Unit 12 Registers and Counters Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
Week #9 Register Transfer and Data Paths
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Computer Organization & Programming Chapter4 Combinatorial Components.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
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.
Instructor: Yuzhuang Hu Another Design Example: PIG (Chapter 7-10) PIG is a single dice game. Two players roll the dice in turns. When.
Computer Design Basics
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
1 CPSC3850 Adders and Simple ALUs Simple Adders Figures 10.1/10.2 Binary half-adder (HA) and full-adder (FA). Digit-set interpretation: {0, 1}
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.
Chapter 4 Computer Design Basics. Chapter Overview Part 1 – Datapaths  Introduction  Datapath Example  Arithmetic Logic Unit (ALU)  Shifter  Datapath.
Modern VLSI Design 4e: Chapter 6 Copyright  2008 Wayne Wolf Topics n Shifters. n Adders and ALUs.
Fall EE 333 Lillevik 333f06-l8 University of Portland School of Engineering Computer Organization Lecture 8 Detailed MIPS datapath Timing overview.
REGISTER TRANSFER & MICROOPERATIONS By Sohaib. Digital System Overview  Each module is built from digital components  Registers  Decoders  Arithmetic.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Chapter 10 – Computer.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Complete Example.
CoE3DJ4 Digital Systems Design
Computer Science 210 Computer Organization Control Circuits Decoders and Multiplexers.
EKT 221 : Chapter 4 Computer Design Basics
ALU & CPU Computer Architecture. Introducing ALU ALU: Arithmetic & Logic Unit –Performs arithmetic operations Addition Subtraction –Performs logic operations.
Computer Architecture Lecture 9 MIPS ALU and Data Paths Ralph Grishman Oct NYU.
1 COMP541 Datapaths I Montek Singh Mar 8, Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8.
Arithmetic Logic Unit (ALU) Introduction to Computer Yung-Yu Chuang with slides by Sedgewick & Wayne ( introcs.cs.princeton.edu ), Nisan & Schocken (
Lecture 15: Pipelined Datapath Soon Tee Teoh CS 147.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 23 Introduction Computer Specification –Instruction Set Architecture (ISA) - the specification.
EKT 221 : Digital 2 Computer Design Basics Date : Lecture : 2 hrs.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Computer Science 210 Computer Organization
Combinational Circuits
Computer Science 210 Computer Organization
Computer Design Basics
More Devices: Control (Making Choices)
Chap 7. Register Transfers and Datapaths
SLIDES FOR CHAPTER 12 REGISTERS AND COUNTERS
Combinational Functions and Circuits
DIGITAL 2 : EKT 221 RTL : Microoperations on a Single Register
Lecture 4: Combinational Functions and Circuits
Register Transfer and Microoperations
Computer Science 210 Computer Organization
Instructor: Alexander Stoytchev
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Overview Part 1 – Datapaths Part 2 – A Simple Computer Introduction
CSC 220: Computer Organization
Computer Design Basics
Combinational Circuits
Electronics for Physicists
Instruction execution and ALU
Presentation transcript:

Lecture 10: Computer Design Basics: The ALU and the Shifter Soon Tee Teoh CS 147

The ALU The Arithmetic/Logic Unit Performs both arithmetic and logic operations The Arithmetic Circuit needs to support the following instructions: Move AG = A IncrementG = A + 1 AddG = A + B SubtractG = A + B’ + 1 DecrementG = A - 1 from table 10-8, pg. 454from table 10-1, pg. 435

The Arithmetic Circuit B input logic B S0S0 S1S1 n n n A C in n X Y n-bit parallel adder G Function table of B input logic S 1 S 0 Y 0 0 all B 1 0 B’ 1 1 all 1 Desired operation Inputs S 1 S 0 C in G = A + B G = A G = A + B G = A + B’ G = A –

The Logic Unit Needs to support the following instructions: ANDG = A ^ B ORG = A v B Exclusive ORG = A + B NOTG = A’ from table 10-8, pg. 454from fig 10-8, pg. 437 A B G S0S0 S1S1 4-to-1 MUX

Putting Arithmetic and Logic Together 4-bit G Select becomes [ S 2 S 1 S 0 C in ] 2-to-1 MUX One Stage of Logic Circuit One Stage of Arithmetic Circuit C in A B S 0 S 1 ABS0S1ABS0S S G C in A B S 0 S 1 S2S2 C out to next bit

R0 n n R1 n n R2 n n R3 n n Load enable decoder load MUX MUX B 0101 Constant Arithmetic/Logic Unit Shifter B Select A Select MB Select A B H Select G Select MUX F 0101 MUX D 0101 Data from Memory MF Select MD Select Destination Select 01

Need to determine input signals Operation MF Select G Select H Select F = A XX F = A XX F = A+B XX F = A+B XX F = A+B’ XX F = A+B’ XX F = A XX F = A XX F = A ^ B 0 1X00 XX F = A v B 0 1X01 XX F = A + B 0 1X10 XX F = A’ 0 1X11 XX F = B 1 XXXX 00 F = sr B 1 XXXX 01 F = sl B 1 XXXX 10 From Table 10-4, page 443

Timing Suppose that the propagation delay for each of the components is as follows –4-1 MUX: 5 ns –2-1 MUX: 3 ns –AND gate: 1 ns –Register: 4 ns –2-4 Decoder: 4 ns –ALU: 15 ns –Shifter: 7 ns Suppose that the set-up time of the registers is 2ns, and the hold time of the registers is 1 ns. What is the minimum clock period possible for this machine? What is the maximum clock frequency this machine can achieve? (Note: Clock frequency = Number of clock cycles per second)

Barrel Shifter Example: 4-bit barrel shifter, can shift input by 0, 1, 2 or 3 bits. S 0 S 1 determines how many bits to shift (left). Use 4 4-to-1 multiplexers. 4-bit Barrel Shifter 4 D 4 Y S1S1 S0S0 D1D0D3D2D1D0D3D2 Y1Y1 S1S1 S0S0 D3D2D1D0D3D2D1D0 Y3Y3 S1S1 S0S0 D0D3D2D1D0D3D2D1 Y0Y0 S1S1 S0S0 D2D1D0D3D2D1D0D3 Y2Y2 S1S1 S0S From Figure 10-9, page 441

Barrel Shifter 32-bit barrel shifter: can use to-1multiplexers However, large fan-in undesirable. So, use layers of multiplexers Y0Y0 D0D2D0D2 D1D3D1D3 D2D0D2D0 D3D1D3D1 Y1Y1 Y2Y2 Y3Y S1S1 S0S0 Example: Use 2 layers of 4 2-to-1 multiplexers for 4-bit barrel shifter