Mark Redekopp, All rights reserved. EE 352 Unit 8. HW Constructs

Similar documents
6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

11.1. Unit 11. Adders & Arithmetic Circuits

Learning Outcomes. Spiral 2 2. Digital System Design DATAPATH COMPONENTS

Learning Outcomes. Spiral 2-2. Digital System Design DATAPATH COMPONENTS

CS356 Unit 12a. Logic Circuits. Combinational Logic Gates BASIC HW. Processor Hardware Organization Pipelining

Learning Outcomes. Spiral 2 2. Digital System Design DATAPATH COMPONENTS

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

ELCT 501: Digital System Design

REGISTER TRANSFER LANGUAGE

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

12.1. CS356 Unit 12. Processor Hardware Organization Pipelining

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

EE 109L Review. Name: Solutions

ECE 341 Midterm Exam

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

EECS 150 Homework 7 Solutions Fall (a) 4.3 The functions for the 7 segment display decoder given in Section 4.3 are:

2008 The McGraw-Hill Companies, Inc. All rights reserved.

DIGITAL SYSTEM DESIGN

EECS Components and Design Techniques for Digital Systems. Lec 07 PLAs and FSMs 9/ Big Idea: boolean functions <> gates.

EE 109L Final Review

Microcomputers. Outline. Number Systems and Digital Logic Review

Lec-6-HW-2-digitalDesign

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

IA Digital Electronics - Supervision I

Chapter 4. The Processor

LECTURE 4. Logic Design

Parallel logic circuits

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

LABORATORY MANUAL VLSI DESIGN LAB EE-330-F

Note: Closed book no notes or other material allowed, no calculators or other electronic devices.

(ii) Simplify and implement the following SOP function using NOR gates:

Chapter 5 Registers & Counters

Written exam for IE1204/5 Digital Design Thursday 29/

Arithmetic Logic Unit. Digital Computer Design

Chapter 4. The Processor

CS429: Computer Organization and Architecture

Chapter 5: The Processor: Datapath and Control

ECE260: Fundamentals of Computer Engineering

Digital Design with SystemVerilog

Lecture 24: Sequential Logic Design. Let s refresh our memory.

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks

The MIPS Processor Datapath

COMPUTER ORGANIZATION AND DESIGN

Computer Architecture: Part III. First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

Outcomes. Spiral 1 / Unit 6. Flip Flops FLIP FLOPS AND REGISTERS. Flip flops and Registers. Outputs only change once per clock period

Code No: R Set No. 1

R a) Simplify the logic functions from binary to seven segment display code converter (8M) b) Simplify the following using Tabular method

Code No: R Set No. 1

CSE140: Components and Design Techniques for Digital Systems

Systems Architecture

Electronic Engineering Part 1 Laboratory Experiment. Digital Circuit Design 1 Combinational Logic. (3 hours)

Sequential Circuit Design: Principle

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

Levels in Processor Design

Reference Sheet for C112 Hardware

Digital Design with FPGAs. By Neeraj Kulkarni

CS61C : Machine Structures

REGISTER TRANSFER AND MICROOPERATIONS

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Hours / 100 Marks Seat No.

QUESTION BANK FOR TEST

Lecture 21: Combinational Circuits. Integrated Circuits. Integrated Circuits, cont. Integrated Circuits Combinational Circuits

Hardware Description Language VHDL (1) Introduction

Contents. Chapter 9 Datapaths Page 1 of 28

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

3. The high voltage level of a digital signal in positive logic is : a) 1 b) 0 c) either 1 or 0

Outcomes. Spiral 1 / Unit 6. Flip Flops FLIP FLOPS AND REGISTERS. Flip flops and Registers. Outputs only change once per clock period

Code No: R Set No. 1

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

CS222: Processor Design

Ripple Counters. Lecture 30 1

END-TERM EXAMINATION

R07

Logic design Ibn Al Haitham collage /Computer science Eng. Sameer

Philadelphia University Department of Computer Science. By Dareen Hamoudeh

For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

Computer Organization and Levels of Abstraction

Chapter 4. The Processor Designing the datapath

ECE 341 Midterm Exam

Computer Architecture (TT 2012)

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

SRI SUKHMANI INSTITUTE OF ENGINEERING AND TECHNOLOGY, DERA BASSI (MOHALI)

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

DIGITAL ELECTRONICS. P41l 3 HOURS

Single Cycle Datapath

Processor (I) - datapath & control. Hwansoo Han

Storage Elements & Sequential Circuits

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Digital Logic. Copyright By NODIA & COMPANY

Single Cycle Datapath

Unit 15. Building Wide Muxes. Building Wide Muxes. Common Hardware Components WIDE MUXES

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Sequential Circuit Design: Principle

Transcription:

EE 352 Unit 8 HW Constructs

Logic Circuits Combinational logic Perform a specific function (mapping of 2 n input combinations to desired output combinations) No internal state or feedback Given a set of inputs, we will always get the same output after some time (propagation) delay equential logic ( torage devices) Registers made up of flip-flops/latches are the fundamental building blocks Controlled by a clock signal ample data on a clock edge and remember that value until the next edge

Transistor Review 3-terminal device Gate input: the control input; it s voltage determines whether current can flow ource & Drain: terminals that current flows from/to Gate +5V Transistor is on ource Drain - - High voltage at gate allows - - - - current to flow ilicon from source to drain Gate V Transistor is off ource Drain - Low voltage at - gate prevents ilicon current from flowing from source to drain

Fundamental Blocks: Logic Gates All digital circuits are built from transistors (voltage controlled switches) which can be on or off. The arrangement of transistors leads to a few basic functions that express logical operations These constructs are known as gates A L Voltage ource B L = A or B Transistors in ERIE = AND Transistors in PARALLEL = OR

AND Gates An AND gate outputs a (true) if ALL inputs are (true) Gates can have several inputs Behavior can be shown in a truth table (listing all possible input combinations and the corresponding output) Z F F X Y F=X Y F X Y Z F=X Y Z F 2-input AND 3-input AND

OR Gates An OR gate outputs a (true) if ANY input is (true) Gates can also have several inputs Z F F X Y F=X+Y F X Y Z F=X+Y+Z F 2-input OR 3-input OR

NOT Gate A NOT gate outputs a (true) if the input is (false) X F X F F = X

NAND and NOR Gates X Y Z X Y Z NAND NOR Z X Y Z X Y Z Z Z Z AND NAND OR NOR True if NOT ALL inputs are true True if NOT ANY input is true

XOR and XNOR Gates X Y Z X Y Z XOR XNOR Z X Y Z X Y Z Z True if an odd # of inputs are true = True if inputs are different True if an even # of inputs are true = True if inputs are same

Logic Functions Map input combinations of n-bits to desired m-bit output Can describe function with a truth table and then find its circuit implementation IN IN IN2 OUT OUT Inputs Logic Circuit Outputs

Functions & Logic Networks We can generate arbitrary logic functions using multiple levels of logic Ex: Full performs one column of addition of two numbers Adds a bit from each number plus a carry-in from the previous column and generates a sum bit & carry-out Mark Redekopp, All rights reserved + = X = Y C in C out C out C in X Y C Full out C in

Functions & Logic Networks Find patterns in the input combinations that uniquely identify the rows where the output is. C i C o X Y Ci Co Level Level 2

Functions & Logic Networks Decompose function into smaller sub-functions that can easily be implemented. Then recombine sub-functions to create overall function C i C o X Y X Ci Y Ci X Y Ci Co Level Level 2

Functions & Logic Networks Functions with multiple outputs can be generated by considering each output as a separate function of the inputs Example: A dedicated 4-bit adder A 3 A 2 A A + B 3 B 2 B B 4 3 2 = A = B = A 3 B 3 A 2 B 2 A B A B C out C in 3 2

Combinational Functional Blocks We can take our logic gates and build up a set of commonly used functional blocks For this class, the common functional blocks include s Multiplexers ALU (Arithmetic and Logic Units)

s Take two numbers as input and produce the binary sum X[3:] Y[3:] 32 32 A B C + C32 OV Z 32 UM[3:]

Multiplexers Along with adders, multiplexers are most used building block n data inputs, log 2 n select bits, output A multiplexer ( mux for short) selects one data input and passes it to the output 4-to- Mux i n data inputs i i2 y output i3 s Mark Redekopp, All rights reserved log 2 n select bits

Multiplexers 4-to- Mux 2 Thus, input 2 = C[3:] is selected and passed to the output A[3:] B[3:] C[3:] D[3:] i i i2 i3 s y C[3:] elect bits = 2 = 2.

Multiplexers 4-to- Mux 2 Thus, input = A[3:] is selected and passed to the output A[3:] B[3:] C[3:] D[3:] i i i2 i3 s y A[3:] elect bits = 2 =.

Multiplexers 2-to- Mux A[3:] i 2 Thus, input = B[3:] is selected and passed to the output B[3:] i s y B[3:] elect bits = 2 =.

Building a Mux To build a mux Decode the select bits and include the corresponding data input. Finally OR all the first level outputs together. I I

Building a Mux To build a mux Decode the select bits and include the corresponding data input. Finally OR all the first level outputs together. I = 2 I I 2 I I I Y Mark Redekopp, All rights reserved I 3

Building a Mux To build a mux Decode the select bits and include the corresponding data input. Finally OR all the first level outputs together. I = 2 I I 2 I 3 Y Mark Redekopp, All rights reserved I 3 I 3 I 3

ALU s Perform a selected operation on two input numbers. F[5:] select the desired operation Func. Code Op. Func. Code Op. _ A LL B _ A+B _ A RL B _ A-B _ A RA B _ A AND B X[3:] Y[3:] F[5:] 32 32 6 A B Func C ALU OV Z RE[3:] 32 _ A * B _ A OR B _ A * B (uns.) _ A XOR B _ A / B _ A NOR B _ A / B (uns.) _ A LT B

imple ALU Design Build an ALU to either ADD or UB X and Y, based on an input F (=Add, =ub) X[3:] Y[3:] 32 32 A B C + OV Z UM[3:] 32 i y RE[3:] X[3:] Y[3:] 32 32 A B C + OV Z DIFF[3:] 32 i s F

Delay in Combinational Logic Beyond the functionality, it is important to understand the timing of logic circuits Each gate (transistor) has inherent propagation delay Propagation Delay = time from the instant the inputs change until the output becomes stable and correct Delay of a circuit is proportional to the longest path (chain) of gates from any input to the output

Delay Example P C P R V B T

Delay Example P C P R V B T 4 Levels of Logic Change in V, B, or T must propagate through the 4 levels of logic

Delay Example P P R C V B T 2 Levels of Logic Change P must propagate through only 2 levels of logic

Timing Example Assume that we were adding one set of inputs and then change to a new set of inputs: Old inputs: = X New inputs: _ = X + = Y + = Y Old inputs: C out Full C in C out Full C in C out Full C in C out Full C in Mark Redekopp, All rights reserved

Timing At the time just before we enter the new input values, all carries are s New inputs: Old inputs: _ + = X = Y Time C out Full C in C out Full C in C out Full C in C Full out C in Mark Redekopp, All rights reserved

Timing The first adder updates his carry and sum but meanwhile other adders output incorrect values due to the lack of correct carries New inputs: _ + = X = Y Time Old inputs: C out Full C in C out Full C in C out Full C in C Full out C in Mark Redekopp, All rights reserved

Timing The second adder updates his carry and sum but later adders are still incorrect New inputs: Old inputs: _ + = X = Y Time 2 C out Full C in C out Full C in C out Full C in C Full out C in Mark Redekopp, All rights reserved

Timing The third adder is now correct but the last adder is still incorrect New inputs: Old inputs: _ + = X = Y Time 3 C out Full C in C out Full C in C out Full C in C Full out C in Mark Redekopp, All rights reserved

Timing Finally, all the adders are correct New inputs: _ + = X = Y Time 4 Old inputs: C out Full C in C out Full C in C out Full C in C Full out C in Mark Redekopp, All rights reserved

equential Devices (Registers) Combinational outputs are only a function of the current inputs Outputs only depend on what the inputs are right now, not one second ago This implies they have no memory (can t remember a value) equential logic devices provide the ability to retain or remember a value by itself (even after the input is changed or removed) Usually have a controlling signal that indicates when the device should update the value it is remembering vs. when it should simply remember that value This controlling signal is usually the clock signal

Clock ignal Alternating high/low voltage pulse train Controls the ordering and timing of operations performed in the processor cycle is usually measured from rising edge to rising edge Clock frequency = # of cycles per second (e.g. 2.8 GHz = 2.8 * 9 cycles per second) (5V) (V) Clock ignal Op. Op. 2 Op. 3 cycle 2.8 GHz = 2.8* 9 cycles per second =.357 ns/cycle Processor

D Flip-Flop Fundamental sequential building block q-output samples the d-input at the instant of the rising clock edge and then retains that value until the next clock edge d(t) Clock ignal Positive-Edge Triggered D-FF D D-FF CLK Q q(t) clk d(t) q(t) t = ns t = 2 ns t = 6 ns t = ns t = 4 ns q(t) d(-2) d(2) d(6) d() d(4)

Positive-Edge Triggered D-FF Q looks at D only at the positive-edge CLK D Q* x Q x Q CLK D Q Q only samples D at the positive edges and then holds that value until the next edge

Registers A Register is a group of D- FF s tied to a common clock and clear (reset) input Reset input allows register to be initialized to s Used to store multiple bit values on each clock cycle D D D2 ET D Q CLR ET D Q CLR ET D Q Q Q Q2 CLR CLK /AR D i Q i * X X D3 ET D Q CLR Q3, X Q i /AR CLK 4-bit Register

Registers Whatever the D value is at the clock edge is sampled and passed to the Q output until the next clock edge CLK /AR D[3:] Q[3:] 4-bit Register On clock edge, D is passed to Q

Clocking Methodologies Typical designs use both combinational and sequential logic equential logic: saves and synchronize data Combinational logic: performs some operation on the data Can use feed-forward or feed-back methodology Inputs Inputs Combo Logic equential Logic Combo Logic equential Logic Combo Logic Register Combinational Logic Manipulates (Processes) Data CLK equential Logic ynchronizes & ave Data CLK CLK Mark Redekopp, All rights reserved Feed-forward tyle Feed-back tyle

Example for(i=; i < ; i++) C[i] = (A[i] + B[i]) / 4; ns per input set = ns total

Feed-forward (Pipelining) Example for(i=; i < ; i++) C[i] = (A[i] + B[i]) / 4; tage tage 2 Mark Redekopp, All rights reserved tage tage 2 Clock A[] + B[] Clock A[] + B[] (A[] + B[]) / 4 Clock 2 A[2] + B[2] (A[] + B[]) / 4

Need for Registers Provides separation between combinational functions Without registers, fast signals could catch-up to data values in the next operation stage 5 ns ignal i ignal j Register Register 2 ns CLK CLK Mark Redekopp, All rights reserved Performing an operation yields signals with different paths and delays We don t want signals from two different data values mixing. Therefore we must collect and synchronize the values from the previous operation before passing them on to the next

Counter Example (+) Register Q CLK