Fundamentals of Computer Systems

Similar documents
Combinational circuits

CSE140: Components and Design Techniques for Digital Systems

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Combinational Logic Design

Binary Adders: Half Adders and Full Adders

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

CSE140 Homework #7 - Solution

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Gates, Circuits, and Boolean Algebra

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

5 Combinatorial Components. 5.0 Full adder. Full subtractor

COMBINATIONAL CIRCUITS

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Understanding Logic Design

3.Basic Gate Combinations

Two-level logic using NAND gates

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

CHAPTER 3 Boolean Algebra and Digital Logic

Using Logic to Design Computer Components

BOOLEAN ALGEBRA & LOGIC GATES

C H A P T E R. Logic Circuits

DEPARTMENT OF INFORMATION TECHNLOGY

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY

Flip-Flops, Registers, Counters, and a Simple Processor

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Sistemas Digitais I LESI - 2º ano

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

LFSR BASED COUNTERS AVINASH AJANE, B.E. A technical report submitted to the Graduate School. in partial fulfillment of the requirements

BINARY CODED DECIMAL: B.C.D.

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

Let s put together a Manual Processor

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Building Blocks for Digital Design

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

Asynchronous counters, except for the first block, work independently from a system clock.

Counters and Decoders

CSE140: Midterm 1 Solution and Rubric

Lab 1: Full Adder 0.0

Module 3: Floyd, Digital Fundamental

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Systems I: Computer Organization and Architecture

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Lecture #21 April 2, 2004 Relays and Adder/Subtractors

Systems I: Computer Organization and Architecture

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

CMOS Binary Full Adder

Figure 8-1 Four Possible Results of Adding Two Bits

Lecture 5: Gate Logic Logic Optimization

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Logic Reference Guide

Lab 1: Study of Gates & Flip-flops

Boolean Algebra Part 1

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

RAM & ROM Based Digital Design. ECE 152A Winter 2012

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

2.0 Chapter Overview. 2.1 Boolean Algebra

DB19. 4-Bit Parallel Adder/ Subtractor. Digital Lab Experiment Board Ver. 1.0

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

Gates, Plexers, Decoders, Registers, Addition and Comparison

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Two's Complement Adder/Subtractor Lab L03

Counters are sequential circuits which "count" through a specific state sequence.

ASYNCHRONOUS COUNTERS

Chapter 1: Digital Systems and Binary Numbers

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

DESIGN OF GATE NETWORKS

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

EE360: Digital Design I Course Syllabus

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Karnaugh Maps (K-map) Alternate representation of a truth table

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

Quartus II Introduction for VHDL Users

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Systems I: Computer Organization and Architecture

Basic Logic Gates Richard E. Haskell

Simplifying Logic Circuits with Karnaugh Maps

Lecture 4: Binary. CS442: Great Insights in Computer Science Michael L. Littman, Spring I-Before-E, Continued

Decimal Number (base 10) Binary Number (base 2)

Lecture 2. Binary and Hexadecimal Numbers

CSE140: Components and Design Techniques for Digital Systems. Introduction. Prof. Tajana Simunic Rosing

2011, The McGraw-Hill Companies, Inc. Chapter 3

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

SIM-PL: Software for teaching computer hardware at secondary schools in the Netherlands

Layout of Multiple Cells

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

Elementary Logic Gates

Transcription:

Fundamentals of Computer Systems Combinational Logic Martha A. Kim Columbia University Fall 23 /

Combinational Circuits Combinational circuits are stateless. Their output is a function only of the current input. Inputs Combinational Circuit Outputs 2 /

3 /

4 /

Overview: Enabler An enabler has two inputs: data: can be several bits, but bit examples for now enable/disable: bit on/off switch When enabled, the circuit s output is its input data. When disabled, the output is. ENABLE ENABLE X DATA OUTPUT X X DATA OUTPUT When enabled When disabled 5 /

Enabler Implementation Note abbreviated truth table: input, A, listed in output column EN F A EN F A A EN F EN A F In both cases, output is enabled when EN =, but they handle the disabled (EN = ) cases differently. 6 /

Encod 7 /

Overview: Decoder A decoder takes a k bit input and produces 2 k single-bit outputs. The input determines which output will be, all others. This representation is called one-hot encoding. O 3 I O 2 I O O 8 /

:2 Decoder The smallest decoder: one bit input, two bit outputs A A A 9 /

2:4 Decoder Decoder outputs are simply minterms. Those values can be constructed as a flat schematic (manageable at small sizes) or hierarchically, as below. B B :2 DEC B AB AB A A :2 DEC A AB A B /

3:8 Decoder Applying hierarchical design again, the 2:4 DEC helps construct a 3:8 DEC. A A :2 DEC A ABC ABC ABC B C BC BC 2:4 DEC BC B C AB C ABC ABC A BC A B C /

Implementing a function with a decoder E.g., F = AC + BC C B A F C B A 7 6 5 4 3 2 F Warning: Easy, but not a minimal circuit. 2 /

Encoders and Decoders k bits 3:8 DEC 2 k bits BCD One-Hot k bits 3:8 ENC 2 k bits 3 /

Priority Encoder An encoder designed to accept any input bit pattern. I 3 I 2 I I V O O X X X X X X X X V = I 3 + I 2 + I + I O = I 3 + I 3 I 2 O = I 3 + I 3 I 2 I 4 /

5 /

Overview: Multiplexer (or Mux) A mux has a k bit selector input and 2 k data inputs (multi or single bit). It outputs a single data output, which has the value of one of the data inputs, according to the selector. D IN 3 C B IN 2 IN OUT B A IN S S 6 /

2: Mux Circuit There are a handful of implementation strategies. E.g., a truth table and k-map are feasible for a design of this size. S I I 7 /

2: Mux Circuit There are a handful of implementation strategies. E.g., a truth table and k-map are feasible for a design of this size. S I I I S I O

2: Mux Circuit There are a handful of implementation strategies. E.g., a truth table and k-map are feasible for a design of this size. S I I I S I :2 Decoder! Enabler! Enabler! O 7 /

4: Mux Circuit I 3 I 2 O I I EN 3 EN 2 EN EN 2:4 DEC S S 8 /

Muxing Wider Values (Overview) I 3 I 2 O I I EN 3 EN 2 EN EN 2:4 DEC S S 9 /

Muxing Wider Values (Components) X 3 X 2 X X Y 3 Y 2 Y Y EN X 3 X 2 X X Z 3 Z 2 Z Z Y 3 Y 2 Y Y 2 /

Using a Mux to Implement an Arbitrary Function Version Think of a function as using k input bits to choose from 2 k outputs. E.g., F = BC + AC A B C F 2 3 4 5 6 7 F A B C

Using a Mux to Implement an Arbitrary Function Version Think of a function as using k input bits to choose from 2 k outputs. E.g., F = BC + AC A B C F 2 3 4 5 6 7 F A B C 2 /

Using a Mux to Implement an Arbitrary Function Version 2 Can we use a smaller MUX? A B C F

Using a Mux to Implement an Arbitrary Function Version 2 Can we use a smaller MUX? A B C F

Using a Mux to Implement an Arbitrary Function Version 2 Can we use a smaller MUX? A B C F

Using a Mux to Implement an Arbitrary Function Version 2 Can we use a smaller MUX? A B C F A B F C C

Using a Mux to Implement an Arbitrary Function Version 2 Can we use a smaller MUX? A B C F A B F C C C 2 3 A B F Instead of feeding just or into the mux, as in Version, one can remove a bit from the select, and feed it into the data ports along with the constant. 22 /

23 /

Overview: Shifters A shifter shifts the inputs bits to the left or to the right. IN n SHIFTER k CNTL n OUT There are various types of shifters. Barrel: Selector bits indicate (in binary) how far to the left to shift the input. L/R with enable: Two control bits (upper enables, lower indicates direction). In either case, bits may roll out or wraparound 24 /

Example: Barrel Shifter with Wraparound 8 SHIFTER 3 8 25 /

Implementation of Barrel Shifter with Wraparound (Part 2) Main idea: wire up all possible shift amounts and use muxes to select correct one. IN 3 IN 2 IN IN 3 2 3 2 3 2 3 2 OUT 3 OUT 2 OUT OUT

Implementation of Barrel Shifter with Wraparound (Part 2) Main idea: wire up all possible shift amounts and use muxes to select correct one. IN 3 IN 2 IN IN 3 2 3 2 3 2 3 2 CNTL, CNTL OUT 3 OUT 2 OUT OUT

Implementation of Barrel Shifter with Wraparound (Part 2) Main idea: wire up all possible shift amounts and use muxes to select correct one. IN 3 IN 2 IN IN 3 2 3 2 3 2 3 2 CNTL, CNTL OUT 3 OUT 2 OUT OUT

Implementation of Barrel Shifter with Wraparound (Part 2) Main idea: wire up all possible shift amounts and use muxes to select correct one. IN 3 IN 2 IN IN 3 2 3 2 3 2 3 2 CNTL, CNTL OUT 3 OUT 2 OUT OUT

Implementation of Barrel Shifter with Wraparound (Part 2) Main idea: wire up all possible shift amounts and use muxes to select correct one. IN 3 IN 2 IN IN 3 2 3 2 3 2 3 2 CNTL, CNTL OUT 3 OUT 2 OUT OUT

Implementation of Barrel Shifter with Wraparound (Part 2) Main idea: wire up all possible shift amounts and use muxes to select correct one. IN 3 IN 2 IN IN 3 2 3 2 3 2 3 2 CNTL, CNTL OUT 3 OUT 2 OUT OUT 26 /

27 /

Computation Always Takes Time 74LS There is a delay between inputs and outputs, due to: Limited currents charging capacitance The speed of light 28 /

The Simplest Timing Model In Out t p Each gate has its own propagation delay t p. When an input changes, any changing outputs do so after t p. Wire delay is zero. 29 /

A More Realistic Timing Model In Out t p(max) t p(min) It is difficult to manufacture two gates with the same delay; better to treat delay as a range. Each gate has a minimum and maximum propagation delay t p(min) and t p(max). Outputs may start changing after t p(min) and stablize no later than t p(min). 3 /

Critical Paths and Short Paths A B C D Y How slow can this be? 3 /

Critical Paths and Short Paths A B C D Y How slow can this be? The critical path has the longest possible delay. t p(max) = t p(max, AND) + t p(max, OR) + t p(max, AND) 3 /

Critical Paths and Short Paths A B C D Y How fast can this be? The shortest path has the least possible delay. t p(min) = t p(min, AND) 3 /

Glitches A glitch is when a single change in input values can cause multiple output changes. A B F C Glitches may occur when there are multiple paths of different length from input I to output O.

Glitches A glitch is when a single change in input values can cause multiple output changes. A B F C Glitches may occur when there are multiple paths of different length from input I to output O.

Glitches A glitch is when a single change in input values can cause multiple output changes. A B F C Glitches may occur when there are multiple paths of different length from input I to output O.

Glitches A glitch is when a single change in input values can cause multiple output changes. A B F C Glitches may occur when there are multiple paths of different length from input I to output O. 32 /

Preventing Single Input Glitches Additional terms can prevent single input glitches (at a cost of a few extra gates). B C A A B F C 33 /

Preventing Single Input Glitches Additional terms can prevent single input glitches (at a cost of a few extra gates). B C A A B F C 33 /

Ari 34 /

Arithmetic: Addition Adding two one-bit numbers: A and B Produces a two-bit result: C and S (carry and sum) A B C S A B Half Adder C S 35 /

Full Adder In general, due to a possible carry in, you need to add three bits: C o C i A B C o S C i A B C o S C i A B S 36 /

A Four-Bit Ripple-Carry Adder A B A 3 B 3 A 2 B 2 A B A B C o FA C i FA FA FA FA S S 4 S 3 S 2 S S 37 /

A Two s Complement Adder/Subtractor To subtract B from A, add A and B. Neat trick: carry in takes care of the + operation. A 3 B 3 A 2 B 2 A B A B SUBTRACT/ADD FA FA FA FA S 4 S 3 S 2 S S 38 /

Overflow in Two s-complement Representation When is the result too positive or too negative? + 2 2 + + + + + + + + + + 39 /

Overflow in Two s-complement Representation When is the result too positive or too negative? + 2 2 + % + % + The result does not fit when the top two carry bits differ. A n Bn A n Bn + + + S n S n + + + + % Overflow 39 /

Ripple-Carry Adders are Slow A3 B3 A2 B2 A B A B C C4 S3 S2 S S The depth of a circuit is the number of gates on a critical path. This four-bit adder has a depth of 8. n-bit ripple-carry adders have a depth of 2n. 4 /

Carry Generate and Propagate The carry chain is the slow part of an adder; carry-lookahead adders reduce its depth using the following trick: C A B K-map for the carry-out function of a full adder For bit i, C i+ = A i B i + A i C i + B i C i = A i B i + C i (A i + B i ) = G i + C i P i Generate G i = A i B i sets carry-out regardless of carry-in. Propagate P i = A i + B i copies carry-in to carry-out. 4 /

Carry Lookahead Adder Expand the carry functions into sum-of-products form: C i+ = G i + C i P i C = G + C P C 2 = G + C P = G + (G + C P )P = G + G P + C P P C 3 = G 2 + C 2 P 2 = G 2 + (G + G P + C P P )P 2 = G 2 + G P 2 + G P P 2 + C P P P 2 C 4 = G 3 + C 3 P 3 = G 3 + (G 2 + G P 2 + G P P 2 + C P P P 2 )P 3 = G 3 + G 2 P 3 + G P 2 P 3 + G P P 2 P 3 + C P P P 2 P 3 42 /

The 74283 Binary Carry-Lookahead Adder (From National Semiconductor) B4 A4 2 9 C4 Σ4 Carry out i has i + product terms, largest of which has i + literals. 5 B3 4 A3 3 Σ3 If wide gates don t slow down, delay is independent of number of bits. 2 B2 3 A2 6 B 5 A 7 C Σ2 4 Σ More realistic: if limited to two-input gates, depth is O(log 2 n). 43 /