Basics of Logic Design Arithmetic Logic Unit (ALU)

Similar documents
Today s Lecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Recursive Example. Review: The C / C++ code. Recursive Example (Continued)

Course Administration

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits

Computer Arithmetic Logical, Integer Addition & Subtraction Chapter

George Boole. IT 3123 Hardware and Software Concepts. Switching Algebra. Boolean Functions. Boolean Functions. Truth Tables

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

Stack Manipulation. Other Issues. How about larger constants? Frame Pointer. PowerPC. Alternative Architectures

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

Concepts Introduced. A 1-Bit Logical Unit. 1-Bit Half Adder (cont.) 1-Bit Half Adder

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers?

CMPUT101 Introduction to Computing - Summer 2002

Describing Combinational circuits in BSV

CS 130 : Computer Systems - II. Shankar Balachandran Dept. of Computer Science & Engineering IIT Madras

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

10/9/2012. Operator is an operation performed over data at runtime. Arithmetic, Logical, Comparison, Assignment, Etc. Operators have precedence

6/23/2011. Review: IEEE-754. CSE 2021: Computer Organization. Exercises. Examples. Shakil M. Khan (adapted from Profs. Roumani & Asif)

EECS 281: Homework #4 Due: Thursday, October 7, 2004

Lists in Lisp and Scheme

LAB L Hardware Building Blocks

LING/C SC/PSYC 438/538. Lecture 21 Sandiway Fong

COMP 423 lecture 11 Jan. 28, 2008

10.5 Graphing Quadratic Functions

CS201 Discussion 10 DRAWTREE + TRIES

Introduction to Computer Engineering EECS 203 dickrp/eecs203/ CMOS transmission gate (TG) TG example

Virtual Machine (Part I)

COMPUTER SCIENCE 123. Foundations of Computer Science. 6. Tuples

5 Regular 4-Sided Composition

CS 241. Fall 2017 Midterm Review Solutions. October 24, Bits and Bytes 1. 3 MIPS Assembler 6. 4 Regular Languages 7.

CMU Fall VLSI CAD

CPSC 213. Polymorphism. Introduction to Computer Systems. Readings for Next Two Lectures. Back to Procedure Calls

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming

Register Transfer Language and Microoperations (Part 2)

MIPS I/O and Interrupt

CS 31: Intro to Systems Digital Logic

ALU Design. 1-bit Full Adder 4-bit Arithmetic circuits. Arithmetic and Logic Unit Flags. Add/Subtract/Increament/Decrement Circuit

CS481: Bioinformatics Algorithms

Introduction to hardware design using VHDL

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

COMBINATORIAL PATTERN MATCHING

CS 241 Week 4 Tutorial Solutions

How to Design REST API? Written Date : March 23, 2015

Parallel logic circuits

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

EXPONENTIAL & POWER GRAPHS

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

Computer Architecture and Organization: L04: Micro-operations

Digital Design. Chapter 6: Optimizations and Tradeoffs

UT1553B BCRT True Dual-port Memory Interface

Hyperbolas. Definition of Hyperbola

ECE468 Computer Organization & Architecture. The Design Process & ALU Design

CSCI 104. Rafael Ferreira da Silva. Slides adapted from: Mark Redekopp and David Kempe

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

12-B FRACTIONS AND DECIMALS

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

Misrepresentation of Preferences

Languages. L((a (b)(c))*) = { ε,a,bc,aa,abc,bca,... } εw = wε = w. εabba = abbaε = abba. (a (b)(c)) *

ASTs, Regex, Parsing, and Pretty Printing

Chapter 1: Boolean Logic Boolean Logic 1

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Computer Organization and Levels of Abstraction

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Integration. October 25, 2016

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFORMATICS 1 COMPUTATION & LOGIC INSTRUCTIONS TO CANDIDATES

Digital Design. Chapter 4: Datapath Components

Chapter 3 Arithmetic for Computers

Integration. September 28, 2017

Theory of Computation CSE 105

CS2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

Homework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22)

Register Transfer Level (RTL) Design

Lecture 6: Signed Numbers & Arithmetic Circuits. BCD (Binary Coded Decimal) Points Addressed in this Lecture

Virtual Machine I: Stack Arithmetic

Slides for Data Mining by I. H. Witten and E. Frank

9.1 apply the distance and midpoint formulas

cisc1110 fall 2010 lecture VI.2 call by value function parameters another call by value example:

Introduction to Integration

Section 10.4 Hyperbolas

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Quiz2 45mins. Personal Number: Problem 1. (20pts) Here is an Table of Perl Regular Ex

CMSC 331 First Midterm Exam

REGISTER TRANSFER AND MICROOPERATIONS

REGISTER TRANSFER AND MICROOPERATIONS

INTRODUCTION TO SIMPLICIAL COMPLEXES

Mid-term exam. Scores. Fall term 2012 KAIST EE209 Programming Structures for EE. Thursday Oct 25, Student's name: Student ID:

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. General Tree Search. Uniform Cost. Lecture 3: A* Search 9/4/2007

Engineer To Engineer Note

EECS150 - Digital Design Lecture 23 - High-level Design and Optimization 3, Parallelism and Pipelining

Combinational Circuits

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork

6. Combinational Circuits. Building Blocks. Digital Circuits. Wires. Q. What is a digital system? A. Digital: signals are 0 or 1.

Product of polynomials. Introduction to Programming (in C++) Numerical algorithms. Product of polynomials. Product of polynomials

Computer Organization and Levels of Abstraction

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers?

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

Digital Design. Chapter 1: Introduction. Digital Design. Copyright 2006 Frank Vahid

Transcription:

Bsics of Logic Design Arithmetic Logic Unit (ALU) CPS 4 Lecture 9 Tody s Lecture Homework #3 Assigned Due Mrch 3 Project Groups ssigned & posted to lckord. Project Specifiction is on We Due April 9 Building the uilding locks Outline Review Digitl uilding locks An Arithmetic Logic Unit (ALU) Reding Appendix B, Chpter 3 CPS 4

Review: Digitl Design Logic Design, Switching Circuits, Digitl Logic Recll: Everything is uilt from trnsistors A trnsistor is switch It is either on or off On or off cn represent True or Flse Given unch of its ( or ) Is this instruction lw or eq? Wht register do I red? How do I dd two numers? Need method to reson out complex expressions CPS 4 3 Review: Boolen Functions Boolen functions hve rguments tht tke two vlues ({T,F} or {,}) nd they return single or set of ({T,F} or {,}) vlue(s). Boolen functions cn lwys e represented y tle clled Truth Tle Exmple: F: {,}3 -> {,} c f f CPS 4 4

Review: Boolen Functions nd Expressions F(A, B, C) = (A * B) + (~A * C) A B C F CPS 4 5 Review: Boolen Gtes Gtes re electronics devices tht implement simple Boolen functions Exmples AND(,) OR(,) NOT() XOR(,) NAND(,) NOR(,) XNOR(,) CPS 4 6

Boolen Functions, Gtes nd Circuits Circuits re mde from network of gtes. (function compositions). XOR(,) F = ~* + ~* XOR(,) F CPS 4 7 Digitl Design Exmples Input: its representing n unsigned numer (n) Output: n s unsigned inry numer Input: its representing n unsigned numer (n) Output: 3-n s unsigned inry numer CPS 4 8

More Design Exmples X is 3-it quntity. Write logic function tht is true if nd only if X contins t lest two s.. Implement the logic function from prolem. using only AND, OR nd NOT gtes. (Note there re no constrints on the numer of gte inputs.) By implement, I men drw the circuit digrm. 3. Write logic function tht is true if nd only if X, when interpreted s n unsigned inry numer, is greter thn the numer 5. 4. Implement the logic function from prolem 3. using only AND, OR nd NOT gtes. (Note there re no constrints on the numer of gte inputs.) CPS 4 9 Prity Exmple The prity code of inry word counts the numer of ones in word. If there re n even numer of ones the prity code is, if there re n odd numer of ones the prity code is. For exmple, the prity of is, nd the prity of is. Construct the truth tle for function tht computes the prity of four-it word. Implement this function using AND, OR nd NOT gtes. (Note there re no constrints on the numer of gte inputs.) CPS 4

Design Exmple Consider mchine with 4 registers Given -it input (register specifier, I, I ) Wnt one of 4 output its (O 3 -O ) to e E.g., llows single register to e ccessed Wht is the circuit for this? CPS 4 Circuit Exmple: Decoder Q 3 I I Q Q Q Q3 Q Q Q I I CPS 4

Circuit Exmple: x MUX Multiplexor (MUX) selects from one of mny inputs y MUX(A, B, S) = (A * S) + (B * ~S) s B Gte Gte 3 Y = (A * S) + (B * ~S) A Gte S CPS 4 3 Exmple 4x MUX c d y c d 3 y s s S CPS 4 4

Arithmetic nd Logicl Opertions in ISA Wht opertions re there? How do we implement them? Consider -it Adder CPS 4 5 Truth Tle for -it Addition + C in Sum C out Wht is the circuit for Sum nd for Cout? CPS 4 6

A -it Cin Sum + Cout C in Sum C out CPS 4 7 Exmple: 4-it dder S3 S S S C out C in 3 3 CPS 4 8

ALU Slice (Almost) Cin 3 Q F Q + NOT OR 3 AND Adder Cout F CPS 4 9 Sutrction How do we perform integer sutrction? Wht is the HW? CPS 4

ALU Slice Cin 3 B inv F Q + - - NOT - OR - 3 AND Q Su B invert Adder Cout F CPS 4 Exmple: Adder/Sutrcter S3 S S S C out C in Add/Su 3 3 Add/Su = => Addition Add/Su = => Sutrction CPS 4

Exmple: (= 53 ) + (= 4 ) (=-33 ) Overflow Exmple: (=-43 ) + (=-54 ) (= 3 ) Exmple3: (= 53 ) + (=- ) (= 3 ) Exmple4: (= ) + (= 4 ) (= 63 ) CPS 4 3 Add/Sutrct With Overflow detection OVERFLOW S n- S n- S S Add/Su n- n- n- n- CPS 4 4

The new ALU Slice Cin 3 Q A F Q + - - NOT - OR - 3 AND Add/su Add/su Cout F CPS 4 5 The ALU Overflow = Zero Q n- Q n- Q Q ALU Slice ALU Slice ALU Slice ALU Slice ALU control n- n- n- n- CPS 4 6

Astrction: The ALU Generl structure Two opernd inputs Control inputs ALU Opertion Input A Input B ALU Zero Result Overflow Crry Out CPS 4 7 The Shift Opertion Consider n 8-it mchine How do I implement the shift opertion? CPS 4 8

Shifter 7 6 5 4 3 Shift- Shift- Shift-4 Q7 Q6 Q5 Q4 Q3 Q Q Q CPS 4 9 Summry thus fr Given Boolen function, generte circuit tht relizes the function. Constructed circuits tht cn dd nd sutrct. The ALU: circuit tht cn dd, sutrct, detect overflow, compre, nd do it-wise opertions (AND, OR, NOT) Shifter Next up: Storge Elements: Registers, Ltches, Buses CPS 4 3