A Little Perspective Combinational Logic Circuits

Similar documents
BOOLEAN ALGEBRA & LOGIC GATES

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

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

Binary Adders: Half Adders and Full Adders

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

Boolean Algebra Part 1

CHAPTER 3 Boolean Algebra and Digital Logic

EE360: Digital Design I Course Syllabus

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Understanding Logic Design

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction

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

Let s put together a Manual Processor

ASYNCHRONOUS COUNTERS

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

Lab 1: Full Adder 0.0

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

The string of digits in the binary number system represents the quantity

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

Simplifying Logic Circuits with Karnaugh Maps

CSE140: Components and Design Techniques for Digital Systems

Basic Logic Gates Richard E. Haskell

Counters and Decoders

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

Gates, Circuits, and Boolean Algebra

Combinational Logic Design

Sistemas Digitais I LESI - 2º ano

CSE140: Midterm 1 Solution and Rubric

Logic Reference Guide

Chapter 2: Boolean Algebra and Logic Gates. Boolean Algebra

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

Two-level logic using NAND gates

CSE140 Homework #7 - Solution

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

C H A P T E R. Logic Circuits

BINARY CODED DECIMAL: B.C.D.

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

Elementary Logic Gates

Logic in Computer Science: Logic Gates

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

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

2.0 Chapter Overview. 2.1 Boolean Algebra

3.Basic Gate Combinations

COMBINATIONAL CIRCUITS

Lecture 5: Gate Logic Logic Optimization

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

Combinational circuits

Chapter 2 Logic Gates and Introduction to Computer Architecture

Two's Complement Adder/Subtractor Lab L03

Figure 8-1 Four Possible Results of Adding Two Bits

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.

Lecture 8: Synchronous Digital Systems

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

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

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

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

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

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

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

Boolean Algebra. Boolean Algebra. Boolean Algebra. Boolean Algebra

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Lecture 8: Binary Multiplication & Division

ENGI 241 Experiment 5 Basic Logic Gates

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

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

6. BOOLEAN LOGIC DESIGN

Digital Electronics Detailed Outline

Lecture 2. Binary and Hexadecimal Numbers

Base Conversion written by Cathy Saxton

(Refer Slide Time: 00:01:16 min)

5 Combinatorial Components. 5.0 Full adder. Full subtractor

CS311 Lecture: Sequential Circuits

Designing Digital Circuits a modern approach. Jonathan Turner

DEPARTMENT OF INFORMATION TECHNLOGY

Chapter 1. Computation theory

CS201: Architecture and Assembly Language

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

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

(1) /30 (2) /30 (3) /40 TOTAL /100

University of St. Thomas ENGR Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54

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

Module 3: Floyd, Digital Fundamental

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

NUMBER SYSTEMS. 1.1 Introduction

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

Gates, Plexers, Decoders, Registers, Addition and Comparison

Combinational Logic Design Process

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

An Efficient RNS to Binary Converter Using the Moduli Set {2n + 1, 2n, 2n 1}

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

Switching Algebra and Logic Gates

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

Lab 17: Building a 4-Digit 7-Segment LED Decoder

CSI 333 Lecture 1 Number Systems

COMPUTER SCIENCE. Paper 1 (THEORY)

Transcription:

A Little Perspective Combinational Logic Circuits COMP 251 Computer Organization and Architecture Fall 2009 Motivating Example Recall our machine s architecture: A Simple ALU Consider an ALU that can perform the following operations: ADD, SUB, AND, OR, NOT C3 C2 C1 C0 Operation 0 0 0 0 B 0 0 0 1 A B 0 0 1 0 A & B 0 0 1 1 A + B 0 1 0 0 ~B 1 1 1 1 A - B All of the computations that can be performed in our assembly/machine languages have to be able to be carried out by the hardware. ADD, SUB, AND, OR, SHL, SHR etc A, B, R 32 bit binary C3-C0 1 bit control lines N, Z, O 1 bit status flags Result is Negative, Zero, Odd Binary Addition Consider the process of adding two, 2 s complement binary numbers: 1 11 0010 0110 0101 0011 or 0101 0011 + 0001 1011 + 0001 1011 0110 1110 0110 1110 With the second approach we can see that the bit in every column is generated as the addition of 3 bits. Thus, to build a machine that can add n bit binary numbers we need only build n copies of a machine that can add three 1 bit binary numbers. Binary Addition Adding three, 1 bit binary numbers: 1 x 1 or more generally y + 0 + z 10 c s s sum of three bits c carry out to next bit. Adding multi-bit numbers: 1

Building Blocks Logic Gates: Electronic components that compute a Boolean function of their inputs. Logic Circuits Logic Circuit: A combination of logic gates that computes some Boolean function. Every circuit can be expressed in three ways: Logic Expression Truth Table Logic Expression z = AB + C Truth Table A B C Z 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 More Building Blocks Some additional logic gates that we ll use: Schematic Expression Converting a Schematic to an Expression: Write expressions for intermediate results. Write expression for output in terms of intermediate results. Substitute intermediate results into output expression. Logic Expression Z = AB + (A + B) Schematic Truth Table Converting a Schematic to a truth table: Write out all possible inputs. Generate truth values for intermediate results. Generate the truth vales for the output. Truth Table A B C D Y Z 0 0 0 1 1 0 1 1 Truth Table Expression Converting a Truth Table to an Expression: Generate an AND term for each row of the truth table with output 1. OR together all of the AND terms. This gives an expression in Sum-Of-Products (SOP) form. Truth Table A B C Z 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 Expression Z = ABC + ABC + ABC + ABC Note: AB AB 2

SOP Expression Schematic Converting SOP Expressions to Schematics: Expression Z = ABC + ABC + ABC + ABC Typical Problem Construct a circuit that detects prime numbers in 3 bit unsigned representation. Primes: 2, 3, 5, 7 Approach? Probe Applet Probe: Circuit simulation program. Available on-line: See Link on web page. www.scit.wlv.ac.uk/~cm1970/probe/webpage/probeapp.html Quick Demo: Click on Start Probe button on web page Select component type Use add new component tool Input Probes Logic Gates Output Probes Truth Table Window Copy: Command+Shift+4 then Space bar Circuit Design Motivating Example: Create a circuit that detects even 3 bit unsigned binary numbers. The input is a 3 bit unsigned binary number (ABC). The output is a single bit (E): 1 if the input is even. 0 if the input is odd. A B C E 0 0 0 (0) 1 0 0 1 (1) 0 0 1 0 (2) 1 0 1 1 (3) 0 1 0 0 (4) 1 1 0 1 (5) 0 1 1 0 (6) 1 1 1 1 (7) 0 E = ABC + ABC + ABC + ABC Evaluating Circuit Quality Cost: The total number of inputs on the logic gates gives an estimate of the cost of the circuit. Speed: The maximum number of gates through which an input must pass before reaching the output gives an estimate of the speed of the circuit. Propagation Delay Example 1: Cost = Delay = Example 2: Cost = Delay = Examples 3

Logic Simplification Boolean Algebra: The Boolean Algebra consists of a collection of identities that can be used to transform Boolean expressions into other equivalent Boolean expressions that may yield better circuits: Fewer gates or inputs (cheaper) Smaller propagation delays (faster) NOTE: Two Boolean expressions, A and B, are equivalent if and only if all possible inputs that make A true also make B true and vice versa. Boolean Identities Name And Form Or Form Identity 1 A = A 0 + A = A Null 0 A = 0 1+ A =1 Idempotent A A = A A + A = A Inverse A A = 0 A + A =1 Commutative A B = B A A + B = B + A Associative (A B) C = A (B C) (A + B) + C = A + (B + C) Distributive A + (B C) = (A + B) (A + C) A (B + C) = A B + A C Absorption A (A + B) = A A + A B = A DeMorgan's A B = A + B A + B = AB Double Negation A= A Exercises Simplify the following circuits to minimize the propagation delay: Circuit 1: Exercises Simplify the following circuits to minimize propagation delay: Circuit 3: Circuit 2: Circuit 4: Exercises Simplify the following circuit to minimize propagation delay: Circuit 5: Recall Our ALU Our ALU that can perform the following basic operations: ADD, SUB, AND, OR, NOT C3 C2 C1 C0 Operation 0 0 0 0 B 0 0 0 1 A B 0 0 1 0 A & B 0 0 1 1 A + B 0 1 0 0 ~B 1 1 1 1 A - B A, B, R 32 bit binary C3-C0 1 bit control lines N, Z, O 1 bit status flags Result is Negative, Zero, Odd 4

Our ALU In reality the basic operations of our ALU will be controlled by C1 and C2 and will consist of only: Inside Our ALU Recall the carry-ripple approach to addition: C1 C0 Operation 0 0 B 0 1 A B 1 0 A & B 1 1 A + B Additional operations will be enabled by control lines C2 and C3 as follows: C2 If 1, Flip the bits of B before performing operation. C3 Set the carry in to the LSb A similar approach for an n bit ALU: Inside a 1-Bit ALU Computing each of the basic operations of the ALU is not difficult: Inside a 1-Bit ALU Picking the correct output: Multiplexers Multiplexer (mux): A circuit that uses n control lines (C) to select one of 2 n inputs (D) as the output (Z). Inside a Multiplexer Like all of our other circuits, a multiplexer can be constructed using the basic logic gates. C1 C0 Z 0 0 D 0 0 1 D 1 1 0 D 2 1 1 D 3 Multiplexers come in 2, 4, 8, 16 etc input varieties. 5

Inside a 1-Bit ALU A full working 1-bit ALU: Propagation Delays What is the propagation delay of the result (r i ) and carry-out (c) for our 1-bit ALU? Propagation Delays What is the propagation delay for an n bit carry-ripple ALU? Propagation Delays Why are propagation delays important? Recall that generally one machine language instruction will execute during each machine cycle. If that instruction uses the ALU, the length of the cycle must be long enough to allow the ALU to perform its computation. 6