Combinational circuits

Size: px
Start display at page:

Download "Combinational circuits"

Transcription

1 omputer Architecture: A onstructive Approach Sequential ircuits Arvind omputer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Revised February 21, 212 (Slides from #16 onwards) L3-1 ombinational circuits A A 1 A n-1 Sel lg(n) Sel lg(n) O O 1 O. O.. A Mux emux.. O n-1 OpSelect A lg(n) eco oder. O O 1 O n-1 A B ALU - Add, Sub,... - And, Or, Xor, Not,... - GT, LT, E, Zero,... Result omp? Such circuits have no cycles (feedback) or state L3-2 1

2 A simple synchronous state element Edge-Triggered Flip-flop Metastability ata is sampled at the rising edge of the clock L3-3 Flip-flops with Write Enables EN EN dangerous! EN EN 1 ata is captured only if EN is on L3-4 2

3 Registers En Register: A group of flip-flops with a common clock and enable Register file: A group of registers with a common clock, input and output port(s) L3-5 Register Files lock WE ReadSel1 ReadSel2 WriteSel Writeata Register file 2R + 1W Readata1 Readata2 WSel Wata RSel1 WE register RSel2 Rata1 register 1 Rata2 No timing issues in reading a selected register L3-6 3

4 Register Files and Ports WE ReadSel1 ReadSel2 WriteSel Writeata ReadSel R/WSel Register file 2R + 1W WE Register file 1R + 1R/W Readata1 Readata2 Readata R/Wata Ports were expensive multiplex a port for read & write L3-7 We can build useful and compact circuits using registers Example: Multiplication by repeated addition L3-8 4

5 Multiplication by repeated addition b Multiplicand 111 (13) a Muliplier * 111 (11) (143) a2 a1 a m2 m1 m add4 add4 mi = (a[i]==)? : b; a3 m3 add4 L3-9 ombinational 32-bit multiply function Bit#(64) mul32(bit#(32) a, Bit#(32) b); Bit#(32) prod = ; Bit#(32) tp = ; for(integer i = ; i < 32; i = i+1) begin Bit#(32) m = (a[i]==)? : b; Bit#(33) sum = add32(m,tp,); prod[i] = sum[]; tp = truncatelsb(sum); end return {tp,prod}; endfunction L3-1 5

6 esign issues with combinational multiply Lot of hardware 32-bit multiply uses 31 addn circuits Long chains of gates 32-bit ripple carry adder has a 31 long chain of gates 32-bit multiply has 31 ripple carry adders in sequence! The speed of a combinational circuit is determined by its longest input-to-output path L3-11 Expressing a loop using registers function Bit#(64) mul32(bit#(32) a, Bit#(32) b); Bit#(32) prod = ; Bit#(32) tp = ; for(integer i = ; i < 32; i = i+1) begin Bit#(32) m = (a[i]==)? : b; Bit#(33) sum = add32(m,tp,); prod[i] = sum[]; tp = truncatelsb(sum); end return {tp,prod}; endfunction Need registers to hold a, b, tp prod and i Update the registers every cycle until we are done L3-12 6

7 Expressing a loop using registers for(integer i = ; i < 32; i = i+1) begin let s = f(s); end return s; f s +1 s i (init ) <32 L3-13 Sequential multiply Reg#(Bit#(32)) a <- mkregu(); Reg#(Bit#(32)) b <- mkregu(); Reg#(Bit#(32)) prod <-mkregu(); Reg#(Bit#(32)) tp <- mkregu(); Reg#(Bit#(6)) i <- mkreg(32); state elements rule mulstep if (i < 32); Bit#(32) m = (a[i]==)? : b; Bit#(33) sum = add32(m,tp,); prod[i] <= sum[]; tp <= sum[32:1]; i <= i+1; endrule So that the rule won t fire until i is set to some other value a rule to describe dynamic behavior L3-14 7

8 ynamic selection requires a mux i aa[i] >> a a[],a[1],a[2], L3-15 Replacing repeated selections by shifts Reg#(Bit#(32)) a <- mkregu(); Reg#(Bit#(32)) b <- mkregu(); Reg#(Bit#(32)) prod <-mkregu(); Reg#(Bit#(32)) tp <- mkregu(); Reg#(Bit#(6)) i <- mkreg(32); rule mulstep if (i < 32); Bit#(32) m = (a[]==)? : b; a <= a >> 1; Bit#(33) sum = add32(m,tp,); prod <= {sum[], (prod >> 1)[3:]}; tp <= sum[32:1]; i <= i+1; endrule L3-16 8

9 Sequential Multiply bin ain b +1 << i a tp s2 s2 s2 s2 == 32 31: & & add 32:1 31 prod << [3:] done = start_en s2 = start_en!done result (high) result (low) L3-17 Multiply Module implicit conditions Int#(32) Int#(32) en Int#(64) st tart result Multiply module interface Multiply; method Action start (Int#(32) a, Int#(32) b); method Int#(64) result(); endinterface Many dierent implementations can provide the same interface: module mkmultiply (Multiply) L3-18 9

10 External interface Multiply Module module mkmultiply32 (Multiply32); Reg#(Bit#(32)) a <- mkregu(); Reg#(Bit#(32)) b <- mkregu(); Reg#(Bit#(32)) prod <-mkregu(); Reg#(Bit#(32)) tp <- mkregu(); Reg#(Bit#(6)) i <- mkreg(32); rule mulstep if (i < 32); Bit#(32) m = (a[]==)? : b; Bit#(33) sum = add32(m,tp,); prod <= {sum[], (prod >> 1)[3:]}; tp <= sum[32:1]; a <= a >> 1; i <= i+1; State Internal behavior endrule method Action start(bit#(32) ain, Bit#(32) bin) if (i == 32); a <= ain; b <= bin; i <= ; tp <= ; prod <= ; endmethod method Bit#(64) result() if (i == 32); return {tp,prod}; endmethod endmodule February 15, 212 L3-19 Module: Method Interface ain bin en result start ult res +1 << ain bin b & & i a tp s2 s2 s2 s2 31: 32:1 add prod << 31 [3:] == 32 result (high) result (low) done OR s2 = start_en s2 = start_en!done L3-2 1

11 Polymorphic Multiply Module implicit conditions n n Int#(32) Int#(32) enab Tadd(n+n) Int#(64) #(Numeric type n) st tart result Multiply module n could be Int#(32), Int#(13),... interface Multiply; n n method Action start (Int#(32) a, Int#(32) b); TAdd#(n,n) method Int#(64) result(); endinterface The module can easily be made polymorphic January 11, L2-21 Sequential n-bit multiply module mkmultiplyn (MultiplyN); Reg#(Bit#(n)) a <- mkregu(); Reg#(Bit#(n)) b <- mkregu(); Reg#(Bit#(n)) prod <-mkregu(); Reg#(Bit#(n)) tp <- mkregu(); Reg#(Bit#(Add#(Tlog(n),1)) i <- mkreg(n); nv = valueof(n); rule mulstep if (i < nv); Bit#(n) m = (a[]==)? : b; Bit#(TAdd#(n,1)) sum = addn(m,tp,); prod <= {sum[], (prod >> 1)[(nv-2):]}; tp <= sum[n:1]; a <= a >> 1; i <= i+1; endrule method Action start(bit#(n) ain, Bit#(n) bin) if (i == nv); a <= ain; b <= bin; i <= ; tp <= ; prod <= ; endmethod method Bit#(TAdd#(n,n)) result() if (i == nv); return {tp,prod}; endmethod endmodule February 15, 212 L

Sequential Circuits. Combinational circuits

Sequential Circuits. Combinational circuits ecoder emux onstructive omputer Architecture Sequential ircuits Arvind omputer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology L04-1 ombinational circuits A 0 A 1 A n-1 Sel...

More information

Constructive Computer Architecture. Combinational ALU. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology

Constructive Computer Architecture. Combinational ALU. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Constructive Computer Architecture Combinational ALU Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology September 11, 2017 ht://csg.csail.mit.edu/6.175 L03-1 Outline

More information

Complex Combinational circuits in Bluespec

Complex Combinational circuits in Bluespec Complex Combinational circuits in Bluespec Arvind Computer Science & Artificial Intelligence Lab M.I.T. L05-1 2-bit Ripple-Carry Adder cascading full adders x[1] y[1] x[0] y[0] c[2] fa c[1] fa 0 Use fa

More information

Binary Arithmetic Circuits

Binary Arithmetic Circuits Binary Arithmetic Circuits Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology L04-1 Building blocks for an Adder A full adder adds two one-bit numbers and a carry

More information

1 /8_ 2 /12 3 /12 4 /25 5 /12 6 /15 7 /16

1 /8_ 2 /12 3 /12 4 /25 5 /12 6 /15 7 /16 M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.S084 Computation Structures Spring 2018 Practice Quiz #1 1 /8_ 2 /12 3 /12

More information

1 /10 2 /12 3 /16 4 /30 5 /12 6 /20

1 /10 2 /12 3 /16 4 /30 5 /12 6 /20 M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.004 Computation Structures Fall 2018 Practice Quiz #1 1 /10 2 /12 3 /16 4

More information

Constructive Computer Architecture. September 9, T01-1. Was everyone added to the class?

Constructive Computer Architecture. September 9, T01-1. Was everyone added to the class? Constructive Computer Architecture Tutorial 1 Andy Wright 6.S195 TA T01-1 Administrative Stuff Piazza Was everyone added to the class? Lab 1 (Due Friday) Has everyone tried logging onto vlsifarm? What

More information

Bluespec-4: Rule Scheduling and Synthesis. Synthesis: From State & Rules into Synchronous FSMs

Bluespec-4: Rule Scheduling and Synthesis. Synthesis: From State & Rules into Synchronous FSMs Bluespec-4: Rule Scheduling and Synthesis Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Based on material prepared by Bluespec Inc, January 2005 March 2, 2005

More information

Hardware Synthesis from Bluespec

Hardware Synthesis from Bluespec Hardware Synthesis from Bluespec Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Happy! Day! L11-1 Guarded interfaces Modules with guarded interfaces

More information

Lab 1: Hello World, Adders, and Multipliers

Lab 1: Hello World, Adders, and Multipliers Lab 1: Hello World, Adders, and Multipliers Andy Wright acwright@mit.edu Updated: December 30, 2013 1 Hello World! 1 interface GCD#(numeric type n); method Action computegcd(uint#(n) a, UInt#(n) b); method

More information

Non-pipelined Multicycle processors

Non-pipelined Multicycle processors Non-pipelined Multicycle processors Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Code for the lecture is available on the course website under the code tab

More information

Sequential Circuits as Modules with Interfaces. Arvind Computer Science & Artificial Intelligence Lab M.I.T.

Sequential Circuits as Modules with Interfaces. Arvind Computer Science & Artificial Intelligence Lab M.I.T. Sequential Circuits as Modules with Interfaces Arvind Computer Science & Artificial Intelligence Lab M.I.T. L07-1 Shortcomings of the current hardware design practice Complex hardware is viewed as a bunch

More information

ECE 341 Midterm Exam

ECE 341 Midterm Exam ECE 341 Midterm Exam Time allowed: 75 minutes Total Points: 75 Points Scored: Name: Problem No. 1 (8 points) For each of the following statements, indicate whether the statement is TRUE or FALSE: (a) A

More information

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

Mark Redekopp, All rights reserved. EE 352 Unit 8. HW Constructs 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

More information

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Multicycle processors Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology L12-1 Single-Cycle RISC Processor As an illustrative example, we use a subset of RISC-V

More information

Digital Design Review

Digital Design Review Digital Design Review Why? You never learned how - traffic light controllers You have forgotten or are rusty You have bad habits (ad hoc, asynchronous design, old technology) You need a method that will

More information

Architecture exploration in Bluespec

Architecture exploration in Bluespec Architecture exploration in Bluespec Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Guest Lecture 6.973 (lecture 7) L-1 Chip design has become too risky a business

More information

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

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book BUILDING BLOCKS OF A BASIC MICROPROCESSOR Part PowerPoint Format of Lecture 3 of Book Decoder Tri-state device Full adder, full subtractor Arithmetic Logic Unit (ALU) Memories Example showing how to write

More information

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology

Multicycle processors. Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology Multicycle processors Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology L14-1 Single-Cycle RISC Processor As an illustrative example, we use a subset of RISC-V

More information

Programming in the Brave New World of Systems-on-a-chip

Programming in the Brave New World of Systems-on-a-chip Programming in the Brave New World of Systems-on-a-chip Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology The 25th International Workshop on Languages and Compilers

More information

ECE 341 Midterm Exam

ECE 341 Midterm Exam ECE 341 Midterm Exam Time allowed: 90 minutes Total Points: 75 Points Scored: Name: Problem No. 1 (10 points) For each of the following statements, indicate whether the statement is TRUE or FALSE: (a)

More information

6.375 Tutorial 1 BSV. Ming Liu. Overview. Parts of a BSV module Lab 2 topics More types in BSV

6.375 Tutorial 1 BSV. Ming Liu. Overview. Parts of a BSV module Lab 2 topics More types in BSV 6.375 Tutorial 1 BSV Ming Liu T01-1 Overview Parts of a BSV module Lab 2 topics More types in BSV T01-2 1 Modules Interfaces Methods provide a way for the outside world to interact with the module State

More information

Spiral 1 / Unit 6. Flip-flops and Registers

Spiral 1 / Unit 6. Flip-flops and Registers 1-5.1 Spiral 1 / Unit 6 Flip-flops and Registers 1-5.2 Outcomes I know the difference between combinational and sequential logic and can name examples of each. I understand latency, throughput, and at

More information

Levels in Processor Design

Levels in Processor Design Levels in Processor Design Circuit design Keywords: transistors, wires etc.results in gates, flip-flops etc. Logical design Putting gates (AND, NAND, ) and flip-flops together to build basic blocks such

More information

Ripple Counters. Lecture 30 1

Ripple Counters. Lecture 30 1 Ripple Counters A register that goes through a prescribed sequence of states upon the application of input pulses is called a counter. The input pulses may be clock pulses, or they may originate from some

More information

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008 CSE 140L Final Exam Prof. Tajana Simunic Rosing Spring 2008 NAME: ID#: Do not start the exam until you are told to. Turn off any cell phones or pagers. Write your name and PID at the top of every page.

More information

Digital Design with FPGAs. By Neeraj Kulkarni

Digital Design with FPGAs. By Neeraj Kulkarni Digital Design with FPGAs By Neeraj Kulkarni Some Basic Electronics Basic Elements: Gates: And, Or, Nor, Nand, Xor.. Memory elements: Flip Flops, Registers.. Techniques to design a circuit using basic

More information

Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE COMP 12111 Two hours - online This paper version is made available as a backup In this event, only MCQ answers written in the boxes on the exam paper will be marked. EXAM PAPER MUST NOT BE REMOVED FROM

More information

Lab5 : Sequential Logic Computation Structures Spring 2019

Lab5 : Sequential Logic Computation Structures Spring 2019 Due date: Thursday March 21st 11:59:59pm EST. Getting started: To create your initial Lab 5 repository, please visit the repository creation page at https://6004.mit.edu/web/spring19/user/labs/lab5. Once

More information

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

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 Anurag Dwivedi Digital Design : Bottom Up Approach Basic Block - Gates Digital Design : Bottom Up Approach Gates -> Flip Flops Digital

More information

Lecture 08: RISC-V Single-Cycle Implementa9on CSE 564 Computer Architecture Summer 2017

Lecture 08: RISC-V Single-Cycle Implementa9on CSE 564 Computer Architecture Summer 2017 Lecture 08: RISC-V Single-Cycle Implementa9on CSE 564 Computer Architecture Summer 2017 Department of Computer Science and Engineering Yonghong Yan yan@oakland.edu www.secs.oakland.edu/~yan 1 Acknowledgements

More information

REGISTER TRANSFER LANGUAGE

REGISTER TRANSFER LANGUAGE REGISTER TRANSFER LANGUAGE The operations executed on the data stored in the registers are called micro operations. Classifications of micro operations Register transfer micro operations Arithmetic micro

More information

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1 COSC 243 Computer Architecture 1 COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1 Overview Last Lecture Flip flops This Lecture Computers Next Lecture Instruction sets and addressing

More information

6.S195: Lab 1 Multiplexers and Adders

6.S195: Lab 1 Multiplexers and Adders 6.S95: Lab Multiplexers and Adders Andy Wright September 6, 23 Due: Friday September 3, 23 Introduction In this lab you will build multiplexers and adders from basic gate primitives. First, you will build

More information

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

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University Digital Circuit Design and Language Datapath Design Chang, Ik Joon Kyunghee University Typical Synchronous Design + Control Section : Finite State Machine + Data Section: Adder, Multiplier, Shift Register

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: January 2, 2018 at 11:23 CS429 Slideset 5: 1 Topics of this Slideset

More information

Integer Multipliers 1

Integer Multipliers 1 Integer Multipliers Multipliers A must have circuit in most S applications A variety of multipliers exists that can be chosen based on their performance Serial, Serial/arallel,Shift and Add, Array, ooth,

More information

EE577A FINAL PROJECT REPORT Design of a General Purpose CPU

EE577A FINAL PROJECT REPORT Design of a General Purpose CPU EE577A FINAL PROJECT REPORT Design of a General Purpose CPU Submitted By Youngseok Lee - 4930239194 Narayana Reddy Lekkala - 9623274062 Chirag Ahuja - 5920609598 Phase 2 Part 1 A. Introduction The core

More information

Clocked Sequential System Design. Multiply Example

Clocked Sequential System Design. Multiply Example Clocked Sequential System Design Example 1 Multipliers (Gradeschool, Modified Gradeschool) Multiply Example (185) (215) 00000000 00000000 ------ 1001101101011111 (39775) 1 0000000000000000

More information

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

Outcomes. Spiral 1 / Unit 6. Flip Flops FLIP FLOPS AND REGISTERS. Flip flops and Registers. Outputs only change once per clock period 1-6.1 1-6.2 Spiral 1 / Unit 6 Flip flops and Registers Mark Redekopp Outcomes I know the difference between combinational and sequential logic and can name examples of each. I understand latency, throughput,

More information

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

Note: Closed book no notes or other material allowed, no calculators or other electronic devices. ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL Fall 2017 Exam Review Note: Closed book no notes or other material allowed, no calculators or other electronic devices. One page

More information

Let s put together a Manual Processor

Let s put together a Manual Processor Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1 The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce

More information

Chapter 5 Registers & Counters

Chapter 5 Registers & Counters University of Wisconsin - Madison ECE/Comp Sci 352 Digital Systems Fundamentals Kewal K. Saluja and Yu Hen Hu Spring 2002 Chapter 5 Registers & Counters Originals by: Charles R. Kime Modified for course

More information

CS 2630 Computer Organization. Meeting 13: Faster arithmetic and more operations Brandon Myers University of Iowa

CS 2630 Computer Organization. Meeting 13: Faster arithmetic and more operations Brandon Myers University of Iowa CS 2630 Computer Organization Meeting 13: Faster arithmetic and more operations Brandon Myers University of Iowa Where we are going Compiler Instruction set architecture (e.g., MIPS) translating source

More information

Real Digital Problem Set #6

Real Digital Problem Set #6 Real igital Problem et #6. (2 points) ketch a block diagram for a magnitude comparator bit-slice circuit. Create K-maps to define the bit-slice circuit, and use them to find optimal logic equations. ketch

More information

Announcements. Midterm 2 next Thursday, 6-7:30pm, 277 Cory Review session on Tuesday, 6-7:30pm, 277 Cory Homework 8 due next Tuesday Labs: project

Announcements. Midterm 2 next Thursday, 6-7:30pm, 277 Cory Review session on Tuesday, 6-7:30pm, 277 Cory Homework 8 due next Tuesday Labs: project - Fall 2002 Lecture 20 Synthesis Sequential Logic Announcements Midterm 2 next Thursday, 6-7:30pm, 277 Cory Review session on Tuesday, 6-7:30pm, 277 Cory Homework 8 due next Tuesday Labs: project» Teams

More information

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

Outcomes. Spiral 1 / Unit 6. Flip Flops FLIP FLOPS AND REGISTERS. Flip flops and Registers. Outputs only change once per clock period 1-5.1 1-5.2 Spiral 1 / Unit 6 Flip flops and Registers Mark Redekopp Outcomes I know the difference between combinational and sequential logic and can name examples of each. I understand latency, throughput,

More information

CS:APP Chapter 4 Computer Architecture Logic Design Randal E. Bryant Carnegie Mellon University

CS:APP Chapter 4 Computer Architecture Logic Design Randal E. Bryant Carnegie Mellon University S:PP hapter 4 omputer rchitecture Logic esign Randal E. Bryant arnegie Mellon University http://csapp.cs.cmu.edu S:PP Overview of Logic esign Fundamental Hardware Requirements ommunication How to get values

More information

Tailoring the 32-Bit ALU to MIPS

Tailoring the 32-Bit ALU to MIPS Tailoring the 32-Bit ALU to MIPS MIPS ALU extensions Overflow detection: Carry into MSB XOR Carry out of MSB Branch instructions Shift instructions Slt instruction Immediate instructions ALU performance

More information

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering Final Examination ECE 241F - Digital Systems Examiners: S. Brown,

More information

Verilog for High Performance

Verilog for High Performance Verilog for High Performance Course Description This course provides all necessary theoretical and practical know-how to write synthesizable HDL code through Verilog standard language. The course goes

More information

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008 CSE 140L Final Exam Prof. Tajana Simunic Rosing Spring 2008 Do not start the exam until you are told to. Turn off any cell phones or pagers. Write your name and PID at the top of every page. Do not separate

More information

Field Programmable Gate Array

Field Programmable Gate Array Field Programmable Gate Array System Arch 27 (Fire Tom Wada) What is FPGA? System Arch 27 (Fire Tom Wada) 2 FPGA Programmable (= reconfigurable) Digital System Component Basic components Combinational

More information

Binary Adders. Ripple-Carry Adder

Binary Adders. Ripple-Carry Adder Ripple-Carry Adder Binary Adders x n y n x y x y c n FA c n - c 2 FA c FA c s n MSB position Longest delay (Critical-path delay): d c(n) = n d carry = 2n gate delays d s(n-) = (n-) d carry +d sum = 2n

More information

Simple Inelastic and

Simple Inelastic and Simple Inelastic and Folded Pipelines Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology L04-1 Pipelining a block C f1 f2 f3 Combinational P f1 f2 f3 Pipeline FP

More information

CHAPTER 12 REGISTERS AND COUNTERS

CHAPTER 12 REGISTERS AND COUNTERS HPTER 2 REGISTERS N OUNTERS ontents 2. Registers and Register Transfers 2.2 Shift Registers 2.3 esign of inary ounters 2.4 ounters for Other Sequences 2.5 ounter esign Using SR and JK FlipFlops 2.6 erivation

More information

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

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( ) 6. Combinational Circuits George Boole (85 864) Claude Shannon (96 2) Digital signals Binary (or logical ) values: or, on or off, high or low voltage Wires. Propagate logical values from place to place.

More information

Readings: Storage unit. Can hold an n-bit value Composed of a group of n flip-flops. Each flip-flop stores 1 bit of information.

Readings: Storage unit. Can hold an n-bit value Composed of a group of n flip-flops. Each flip-flop stores 1 bit of information. Registers Readings: 5.8-5.9.3 Storage unit. Can hold an n-bit value Composed of a group of n flip-flops Each flip-flop stores 1 bit of information ff ff ff ff 178 Controlled Register Reset Load Action

More information

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007 EECS 5 - Components and Design Techniques for Digital Systems Lec 2 RTL Design Optimization /6/27 Shauki Elassaad Electrical Engineering and Computer Sciences University of California, Berkeley Slides

More information

CS222: Processor Design

CS222: Processor Design CS222: Processor Design Dr. A. Sahu Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati Processor Design building blocks Outline A simple implementation: Single Cycle Data pathandcontrol

More information

Design Example: 4-bit Multiplier

Design Example: 4-bit Multiplier Design Example: 4-bit Multiplier Consider how we normally multiply numbers: 123 x 264 492 7380 24600 32472 Binary multiplication is similar. (Note that the product of two 4-bit numbers is potentially an

More information

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

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE One and a half hours Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE Fundamentals of Computer Engineering Date: Thursday 21st January 2016 Time: 14:00-15:30 Answer BOTH Questions

More information

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering VERILOG FUNDAMENTALS HDLs HISTORY HOW FPGA & VERILOG ARE RELATED CODING IN VERILOG HDLs HISTORY HDL HARDWARE DESCRIPTION LANGUAGE

More information

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS EE 2 Lab Manual, EE Department, KFUPM EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS OBJECTIVES: Design and implement a circuit that performs basic binary arithmetic operations such as addition, subtraction,

More information

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis Synthesis of Language Constructs 1 Nets Nets declared to be input or output ports are retained Internal nets may be eliminated due to logic optimization User may force a net to exist trireg, tri0, tri1

More information

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit Nurul Hazlina 1 1. Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit Nurul Hazlina 2 Introduction 1. Digital circuits are frequently used for arithmetic operations 2. Fundamental

More information

Integer Multiplication and Division

Integer Multiplication and Division Integer Multiplication and Division for ENCM 369: Computer Organization Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 208 Integer

More information

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language) Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits Hardware Description Language) 1 Standard ICs PLD: Programmable Logic Device CPLD: Complex PLD FPGA: Field Programmable

More information

Arvind (with the help of Nirav Dave) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology

Arvind (with the help of Nirav Dave) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology Stmt FSM Arvind (with the help of Nirav Dave) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology March 10, 2010 http://csg.csail.mit.edu/snu L9-1 Motivation Some common

More information

ELCT 501: Digital System Design

ELCT 501: Digital System Design ELCT 501: Digital System Lecture 4: CAD tools (Continued) Dr. Mohamed Abd El Ghany, Basic VHDL Concept Via an Example Problem: write VHDL code for 1-bit adder 4-bit adder 2 1-bit adder Inputs: A (1 bit)

More information

R10. II B. Tech I Semester, Supplementary Examinations, May

R10. II B. Tech I Semester, Supplementary Examinations, May SET - 1 1. a) Convert the following decimal numbers into an equivalent binary numbers. i) 53.625 ii) 4097.188 iii) 167 iv) 0.4475 b) Add the following numbers using 2 s complement method. i) -48 and +31

More information

Sizhuo Zhang TA

Sizhuo Zhang TA Constructive Computer Architecture Tutorial 2 Advanced BSV Sizhuo Zhang 6.175 TA T02-1 EHR and Scheduling Design example Up/down counter interface Counter; Bit#(8) read; Action increment(bit#(8) x); Action

More information

Course Project Part 1

Course Project Part 1 1 1 4 to 1 MUX with 8 bit Inputs A Complete Circuit 1 B 8 bit Enabler 3 C 8 bit MUX Merger 5 2 8 bit Adder A Complete Circuit 7 B Full Adder 9 Course Project Part 1 Table of Contents 1A 4 to 1 MUX with

More information

MCMASTER UNIVERSITY EMBEDDED SYSTEMS

MCMASTER UNIVERSITY EMBEDDED SYSTEMS MCMASTER UNIVERSITY EMBEDDED SYSTEMS Computer Engineering 4DS4 Lecture Revision of Digital Systems Amin Vali January 26 Course material belongs to DrNNicolici Field programmable gate arrays (FPGAs) x x

More information

Arithmetic Logic Unit. Digital Computer Design

Arithmetic Logic Unit. Digital Computer Design Arithmetic Logic Unit Digital Computer Design Arithmetic Circuits Arithmetic circuits are the central building blocks of computers. Computers and digital logic perform many arithmetic functions: addition,

More information

Hardware Description Language VHDL (1) Introduction

Hardware Description Language VHDL (1) Introduction Hardware Description Language VHDL (1) Introduction Digital Radiation Measurement and Spectroscopy NE/RHP 537 Introduction Hardware description language (HDL) Intended to describe circuits textually, for

More information

EKT 422/4 COMPUTER ARCHITECTURE. MINI PROJECT : Design of an Arithmetic Logic Unit

EKT 422/4 COMPUTER ARCHITECTURE. MINI PROJECT : Design of an Arithmetic Logic Unit EKT 422/4 COMPUTER ARCHITECTURE MINI PROJECT : Design of an Arithmetic Logic Unit Objective Students will design and build a customized Arithmetic Logic Unit (ALU). It will perform 16 different operations

More information

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits EE 459/5 HL Based igital esign with Programmable Logic Lecture 6 ombinational and sequential circuits Read before class: hapter 2 from textbook Overview ombinational circuits Multiplexer, decoders, encoders,

More information

DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN DIGITAL SYSTEM DESIGN Prepared By: Engr. Yousaf Hameed Lab Engineer BASIC ELECTRICAL & DIGITAL SYSTEMS LAB DEPARTMENT OF ELECTRICAL ENGINEERING Digital System Design 1 Name: Registration No: Roll No: Semester:

More information

HIGH-LEVEL SYNTHESIS

HIGH-LEVEL SYNTHESIS HIGH-LEVEL SYNTHESIS Page 1 HIGH-LEVEL SYNTHESIS High-level synthesis: the automatic addition of structural information to a design described by an algorithm. BEHAVIORAL D. STRUCTURAL D. Systems Algorithms

More information

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

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S.

More information

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

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

More information

ECE 341. Lecture # 6

ECE 341. Lecture # 6 ECE 34 Lecture # 6 Instructor: Zeshan Chishti zeshan@pdx.edu October 5, 24 Portland State University Lecture Topics Design of Fast Adders Carry Looakahead Adders (CLA) Blocked Carry-Lookahead Adders Multiplication

More information

Overview. EECS Components and Design Techniques for Digital Systems. Lec 16 Arithmetic II (Multiplication) Computer Number Systems.

Overview. EECS Components and Design Techniques for Digital Systems. Lec 16 Arithmetic II (Multiplication) Computer Number Systems. Overview EE 15 - omponents and Design Techniques for Digital ystems Lec 16 Arithmetic II (Multiplication) Review of Addition Overflow Multiplication Further adder optimizations for multiplication LA in

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

More information

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad-500 014 Subject: Digital Design Using Verilog Hdl Class : ECE-II Group A (Short Answer Questions) UNIT-I 1 Define verilog HDL? 2 List levels of

More information

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1 ACS College of Engineering Department of Biomedical Engineering Logic Design Lab pre lab questions (2015-2016) Cycle-1 1. What is a combinational circuit? 2. What are the various methods of simplifying

More information

Week 6: Processor Components

Week 6: Processor Components Week 6: Processor Components Microprocessors So far, we ve been about making devices, such such as adders, counters and registers. The ultimate goal is to make a microprocessor, which is a digital device

More information

Injntu.com Injntu.com Injntu.com R16

Injntu.com Injntu.com Injntu.com R16 1. a) What are the three methods of obtaining the 2 s complement of a given binary (3M) number? b) What do you mean by K-map? Name it advantages and disadvantages. (3M) c) Distinguish between a half-adder

More information

Topics. Midterm Finish Chapter 7

Topics. Midterm Finish Chapter 7 Lecture 9 Topics Midterm Finish Chapter 7 Xilinx FPGAs Chapter 7 Spartan 3E Architecture Source: Spartan-3E FPGA Family Datasheet CLB Configurable Logic Blocks Each CLB contains four slices Each slice

More information

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

Computer Architecture: Part III. First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University Computer Architecture: Part III First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University Outline Decoders Multiplexers Registers Shift Registers Binary Counters Memory

More information

In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified.

In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified. 1 In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified. I will also introduce the idea of a testbench as part of a design specification.

More information

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

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 I hope you have completed Part 1 of the Experiment. This lecture leads you to Part 2 of the experiment and hopefully helps you with your progress to Part 2. It covers a number of topics: 1. How do we specify

More information

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2 VHDL 2 Combinational Logic Circuits Reference: Roth/John Text: Chapter 2 Combinational logic -- Behavior can be specified as concurrent signal assignments -- These model concurrent operation of hardware

More information

Modeling Synchronous Logic Circuits. Debdeep Mukhopadhyay IIT Madras

Modeling Synchronous Logic Circuits. Debdeep Mukhopadhyay IIT Madras Modeling Synchronous Logic Circuits Debdeep Mukhopadhyay IIT Madras Basic Sequential Circuits A combinational circuit produces output solely depending on the current input. But a sequential circuit remembers

More information

Implementing RISC-V Interpreter in Hardware

Implementing RISC-V Interpreter in Hardware Implementing RISC-V Interpreter in Hardware Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology October 16, 2018 MIT 6.004 Fall 2018 L11-1 Instruction interpreter

More information

Lab 2: Multipliers 6.175: Constructive Computer Architecture Fall 2014

Lab 2: Multipliers 6.175: Constructive Computer Architecture Fall 2014 Lab 2: Multipliers Due: Monday September 22, 2014 1 Introduction In this lab you will be building different multiplier implementations and testing them using custom instantiations of provided test bench

More information

Combinational Circuits in Bluespec

Combinational Circuits in Bluespec Combinational Circuits in Bluespec Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology February 13, 2013 http://csg.csail.mit.edu/6.375 L031 Combinational circuits

More information

Chapter 3 Part 2 Combinational Logic Design

Chapter 3 Part 2 Combinational Logic Design University of Wisconsin - Madison EE/omp ci 352 Digital ystems Fundamentals Kewal K. aluja and u Hen Hu pring 2002 hapter 3 Part 2 ombinational Logic Design Originals by: harles R. Kime and Tom Kamisnski

More information

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

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks ECE 331: N0 ECE230 Review Professor Andrew Mason Michigan State University Spring 2013 1.1 Announcements Opening Remarks HW1 due next Mon Labs begin in week 4 No class next-next Mon MLK Day ECE230 Review

More information