Computer Organization and Design Lecture 16 – Combinational Logic Blocks Close call!   Cal squeaked by Washington in Overtime 31-24. We win, and then.

Slides:



Advertisements
Similar presentations
Lecture 19: Hardware for Arithmetic Today’s topic –Designing an ALU –Carry Look-Ahead Adder 1.
Advertisements

CS61C L16 Representations of Combinatorial Logic Circuits (1) Beamer, Summer 2007 © UCB Scott Beamer Instructor inst.eecs.berkeley.edu/~cs61c CS61C :
CS61C L15 Representations of Combinatorial Logic Circuits (1) Garcia, Fall 2005 © UCB Lecturer PSOE, new dad Dan Garcia
CS61C L22 Representations of Combinatorial Logic Circuits (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C L29 Combinational Logic Blocks (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS61C L23 Combinational Logic Blocks (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
CS61C L23 Combinational Logic Blocks (1) Garcia, Spring 2007 © UCB Salamander robot!  Swiss scientists have built a robot that can both swim and walk.
Gates and Circuits. Three Main Gates  AND  OR  NOT.
CS61C L24 Introduction to CPU Design (1) Garcia, Spring 2007 © UCB Cell pic to web site  A new MS app lets people search the web based on a digital cell.
Arithmetic II CPSC 321 E. J. Kim. Today’s Menu Arithmetic-Logic Units Logic Design Revisited Faster Addition Multiplication (if time permits)
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Spring 2007 © UCB 3.6 TB DVDs? Maybe!  Researchers at Harvard have found a way to use.
CS61C L22 Representations of Combinatorial Logic Circuits (1) Garcia, Spring 2008 © UCB 100 MPG Car contest!  The X Prize Foundation has put up two prizes;
CS61C L18 Introduction to CPU Design (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
Computer Structure - The ALU Goal: Build an ALU  The Arithmetic Logic Unit or ALU is the device that performs arithmetic and logical operations in the.
CS61C L17 Combinatorial Logic Blocks (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
CS61C L22 Representations of Combinatorial Logic Circuits (1) Eric, Spring 2010 © UCB Cal Alumni Wins 2009 Turing Award! Charles P. Thacker was named.
CS61C L24 Latches (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
CS61C L18 Combinational Logic Blocks, Latches (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
CS61C L23 Combinational Logic Blocks (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c UC.
CS61C L24 Introduction to CPU Design (1) Garcia, Fall 2006 © UCB Fedora Core 6 (FC6) just out  The latest version of the distro has been released; they.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 24 Introduction to CPU design Stanford researchers developing 3D camera.
CS 61C L23 Combinational Logic Blocks (1) Garcia, Fall 2004 © UCB slashdot.org/article.pl?sid=04/10/21/ &tid=126&tid=216 Lecturer PSOE Dan Garcia.
CS 61C L15 Blocks (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #15: Combinational Logic Blocks.
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
CS 61C L28 Representations of Combinatorial Logic Circuits (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C L22 Representations of Combinatorial Logic Circuits (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C L30 Verilog I (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
CS61C L25 CPU Design : Designing a Single-Cycle CPU (1) Garcia, Spring 2007 © UCB Google Summer of Code  Student applications are now open (through );
CS61C L17 Combinational Logic (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #17.
1  1998 Morgan Kaufmann Publishers Chapter Four Arithmetic for Computers.
Chapter 3 Arithmetic for Computers. Arithmetic Where we've been: Abstractions: Instruction Set Architecture Assembly Language and Machine Language What's.
CS 61C L15 State & Blocks (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #15: State 2 and Blocks.
CS61C L25 Representations of Combinational Logic Circuits (1) Garcia, Spring 2013 © UCB Android Brain on Robots!  “Half the weight of some robots is.
Computer Science 210 Computer Organization The Arithmetic Logic Unit.
Chapter 6-1 ALU, Adder and Subtractor
CS61C L26 Combinational Logic Blocks (1) Garcia, Spring 2014 © UCB Very fast 3D Micro Printer  A new company called Nanoscribe has developed a fabrication.
Computing Systems Designing a basic ALU.
CS3350B Computer Architecture Winter 2015 Lecture 5.4: Combinational Logic Blocks Marc Moreno Maza [Adapted from lectures.
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
1 Arithmetic I Instructor: Mozafar Bag-Mohammadi Ilam University.
COMP541 Arithmetic Circuits
CS 61C L4.1.2 State (1) K. Meinz, Summer 2004 © UCB CS61C : Machine Structures Lecture State and FSMs Kurt Meinz inst.eecs.berkeley.edu/~cs61c.
1  2004 Morgan Kaufmann Publishers Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let’s review Boolean.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
ECE/CS 552: Arithmetic I Instructor:Mikko H Lipasti Fall 2010 University of Wisconsin-Madison Lecture notes partially based on set created by Mark Hill.
9/23/2004Comp 120 Fall September Chapter 4 – Arithmetic and its implementation Assignments 5,6 and 7 posted to the class web page.
CS 61C: Great Ideas in Computer Architecture Finite State Machines, Functional Units 1 Instructors: Vladimir Stojanovic and Nicholas Weaver
CS 110 Computer Architecture Lecture 9: Finite State Machines, Functional Units Instructor: Sören Schwertfeger School of.
Revisão de Circuitos Lógicos PARTE III. Review Use this table and techniques we learned to transform from 1 to another.
Combinational Circuits
Lecture 11: Hardware for Arithmetic
Senior Lecturer SOE Dan Garcia
Instructors: Randy H. Katz David A. Patterson
minecraft.gamepedia.com/Tutorials/Basic_Logic_Gates
Senior Lecturer SOE Dan Garcia
Inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 23 – Representations of Combinatorial Logic Circuits TA/Punner.
Lecturer SOE Dan Garcia
en.wikipedia.org/wiki/Conway%27s_Game_of_Life
Lecture 11: Hardware for Arithmetic
Hello to Casey Holgado listening from Oklahoma State!
robosavvy.com/forum/viewtopic.php?p=32542
COMS 361 Computer Organization
Instructor Paul Pearce
TA David “The Punner” Eitan Poll
Combinational Circuits
Lecturer SOE Dan Garcia
Instructor: Michael Greenbaum
Presentation transcript:

Computer Organization and Design Lecture 16 – Combinational Logic Blocks Close call!   Cal squeaked by Washington in Overtime We win, and then we drop a spot in the polls. Yikes! UCLA soon. calbears.cstv.com

Review Use this table and techniques we learned to transform from 1 to another

Today Data Multiplexors Arithmetic and Logic Unit Adder/Subtractor

Data Multiplexor (here 2-to-1, n-bit-wide) “mux”

N 个 1-bit-wide mux How many rows in TT?

如何构建 1-bit-wide mux?

4-to-1 Multiplexor? 真值表中有多少行 ?

其它方式完成 ? Ans: 层次结构 !

算术逻辑单元 Arithmetic and Logic Unit 大多数处理器都包含一个称为算术逻辑单元的逻 辑块 “Arithmetic and Logic Unit” (ALU) 下面将讲授进行加 (ADD), 减 (SUB), 按位与 (AND), 按位或 (bitwise OR)

Our simple ALU

加 / 减法设计 – 如何进行 ? 真值表, 然后确定与或范式, 然后简化 将问题分解为更小的问题,使用层次方法或者连接 的方法进行求解

Adder/Subtracter – One-bit adder LSB…

Adder/Subtracter – One-bit adder (1/2)…

Adder/Subtracter – One-bit adder (2/2)…

N 1-bit adders  1 N-bit adder 关于溢出 ? Overflow = c n ? 无符号数是这样的 +++ b0b0

What about overflow? 表示 : 数 正数 反 补

关于溢出 (overflow)? 考虑二位有符号数加法及溢出 & overflow: 10 = or = only 00 = 0 NOTHING! 01 = only Highest adder C 1 = Carry-in = C in, C 2 = Carry-out = C out C in but no C out C out but no C in ± # What op?

What about overflow? Consider a 2-bit signed # & overflow: 10 = or = only 00 = 0 NOTHING! 01 = only Overflows when… C in, but no C out  A,B both > 0, overflow! C out, but no C in  A,B both < 0, overflow! ± #

Overflow detection? Another explain 当 a,b 不同号时,不会溢出 两个正数相加 在最高位不可能有进位 在次高位有进位,则加成了负数 两个负数相加 在最高位总有进位 如果次高位无进位,则加成了负数 无论何种情况,只要两个进行不同则发生溢出

Extremely Clever Subtractor A - B = A + (-B) = A + ~B +1 1 xor b =~b 0 xor b = b

Peer Instruction A. Truth table for mux with 4-bits of signals has 2 4 rows B. We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl C. If 1-bit adder delay is T, the N-bit adder delay would also be T ABC 1: FFF 2: FFT 3: FTF 4: FTT 5: TFF 6: TFT 7: TTF 8: TTT

Peer Instruction Answer A. Truth table for mux with 4-bits of signals is 2 4 rows long B. We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl C. If 1-bit adder delay is T, the N-bit adder delay would also be T ABC 1: FFF 2: FFT 3: FTF 4: FTT 5: TFF 6: TFT 7: TTF 8: TTT A. Truth table for mux with 4-bits of signals controls 16 inputs, for a total of 20 inputs, so truth table is 2 20 rows…FALSE B. We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl … TRUE C. What about the cascading carry? FALSE

“And In conclusion…” Use muxes to select among input S input bits selects 2S inputs Each input can be n-bits wide, indep of S Implement muxes hierarchically ALU can be implemented using a mux Coupled with basic block elements N-bit adder-subtractor done using N 1- bit adders with XOR gates on input XOR serves as conditional inverter

Intro to hardware description language

Verilog Hardware Description Language

Very Brief Verilog Introduction

Verilog Example : 4-input multiplexor

Verilog Example : Accumulator

Last word (for now) on Verilog

Verilog and Boolean Equations Besides the two major styles, structural and behavioral, a third style (somewhat in between) called dataflow Continuous Assignment statements // y = ab + ac + bc; wire a, b, c, y; assign y = a & b | a & c | b & c; Not like a normal assignment in programming languages. This assign happens continuously. Whenever anything on the RHS changes, the LHS is updated.

Verilog Continuous Assign The Boolean operators are defined to be bitwise: // Y = AB; wire A[3:0], B[3:0]; assign Y = A & B; // Or equivalently assign Y[0] = A[0] & B[0]; assign Y[1] = A[1] & B[1]; assign Y[2] = A[2] & B[2]; assign Y[3] = A[3] & B[3];

Verilog Bitwise Operators

Concatenation in Verilog wire A[7:0], B[7:0]; wire C[3:0], D[11:0]; wire Y[15:0]; assign Y = { A, B }; // Makes a longer bit vector from A with B Concatenation on the LHS assign { C, D } = Y; // Splits up Y into pieces assign { C, D } = { A, B }; // Also works assign {OPCODE, RS, RT, IMMED} = INSTRUCTION; // Might be useful

Replication n{m} Replicates m n-times. Example: wire X[31:0]; wire IMMED[15:0]; assign X = { 16{IMMED[15]}, IMMED}; // Sign-extends IMMEDIATE into X Concatenation, replication operations don’t generate any combinational logic, then only generate wires.

Conditional Operator