Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 1 of 5. Use pencil!

Similar documents
Abstraction. Levels of abstraction in a computer system

Abstraction. ENGR Michael S. McCorquodale, Peter M. Chen

ENGR 100 Midterm (CSE Part) Winter 2014

What s a Tri-state Buffer?

Engineering 100 Midterm Exam Technical Part Fall 2010

LAB #3: ADDERS and COMPARATORS using 3 types of Verilog Modeling

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Building Memory

Lecture #21 March 31, 2004 Introduction to Gates and Circuits

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

COMP12111 Fundamentals of Computer Engineering Paul Nutter Vasilis Pavlidis Comments

ECE331: Hardware Organization and Design

EECS 270 Midterm Exam

COMP combinational logic 1 Jan. 18, 2016

In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and

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

HW D1: Gates & Flops: Spring 2015

Finite-State Machine (FSM) Design

VERILOG HDL. 1 ENGN3213: Digital Systems and Microprocessors L#5-6

Lab 16: Tri-State Busses and Memory U.C. Davis Physics 116B Note: We may use a more modern RAM chip. Pinouts, etc. will be provided.

ENSC E-123: HW D3: Counter Applications; Counter in Verilog

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

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

Slide Set 9. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

Hardware Description Languages (HDLs) Verilog

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

COS 116 The Computational Universe Laboratory 8: Digital Logic II

CSE140L: Components and Design Techniques for Digital Systems Lab. Verilog HDL. Instructor: Mohsen Imani UC San Diego. Source: Eric Crabill, Xilinx

Week 6: Processor Components

CMPE 413/ CMSC 711. Project Specification: 16 bit 2 s complement Adder and 8 bit 2 s complement multiplier. GND. Input bus. Latches I[8]-I[15]

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

Topic Notes: Building Memory

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

(Refer Slide Time 6:48)

EECS 470: Computer Architecture. Discussion #2 Friday, September 14, 2007

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

Memory and Programmable Logic

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

Physics 364, Fall 2012, reading due your answers to before the end of Wednesday s lab.

EECS 140 Laboratory Exercise 5 Prime Number Recognition

EN2911X: Reconfigurable Computing Lecture 05: Verilog (2)

Physics 364, Fall 2014, reading due your answers to by 11pm on Sunday

One and a half hours. Section A is COMPULSORY

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

Tutorial: Working with the Xilinx tools 14.4

Student Number: UTORid: Question 0. [1 mark] Read and follow all instructions on this page, and fill in all fields.

CS429: Computer Organization and Architecture

Lab 1: FPGA Physical Layout

1.2 Adding Integers. Contents: Numbers on the Number Lines Adding Signed Numbers on the Number Line

CS/COE 0447 Example Problems for Exam 2 Spring 2011

Introduction to Verilog design. Design flow (from the book) Hierarchical Design. Lecture 2

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

Course Project Part 1

CENG 241 Digital Design 1

A3 A2 A1 A0 Sum4 Sum3 Sum2 Sum1 Sum

Introduction to Verilog design. Design flow (from the book)

Lecture 1: Overview

ECE 152A LABORATORY 2

CARLETON UNIVERSITY. Laboratory 2.0

CS 126 Lecture A5: Computer Architecture

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AN:p ENGINEERING. ECE241F - Digital Syst~ms Final Examination

VERILOG HDL. (and C) 1 ENGN3213: Digital Systems and Microprocessors L#5-6

Basic Reliable Transport Protocols

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

Binary Adders: Half Adders and Full Adders

Data paths for MIPS instructions


Integer Multiplication and Division

CPE 200L LABORATORY 4: INTRODUCTION TO DE2 BOARD UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND:

Computer Architecture Review. ICS332 - Spring 2016 Operating Systems

Structural Modeling with Verilog

EECE 353: Digital Systems Design Lecture 10: Datapath Circuits

Verilog for Synthesis Ing. Pullini Antonio

University of Pennsylvania Department of Electrical and System Engineering Computer Organization

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

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

Table of Laplace Transforms

Elec 326: Digital Logic Design

LECTURE 4. Logic Design

Lecture 4: More Lab 1

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

Many ways to build logic out of MOSFETs

Combinational Logic Design with Verilog. ECE 152A Winter 2012

Introduction to Verilog

2.1 Transforming Linear Functions

Design of Digital Circuits ( L) ETH Zürich, Spring 2017

ENGR 3410: MP #1 MIPS 32-bit Register File

Section 0.3 The Order of Operations

ENGR 3410: MP #1 MIPS 32-bit Register File

Course Topics - Outline

EXPERIMENT NUMBER 7 HIERARCHICAL DESIGN OF A FOUR BIT ADDER (EDA-2)

Introduction to Verilog HDL

Microcomputers. Outline. Number Systems and Digital Logic Review

EECS150 - Digital Design Lecture 09 - Parallelism

EECS150: Components and Design Techniques for Digital Systems

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 14 EE141

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Transcription:

Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 1 of 5 Use pencil! Last time Introduced basic logic and some terms including bus, word, register and combinational logic. Talked about schematic representation. Introduced Verilog. o Basics of Verilog including @*, wire, reg, etc. o Discussed how to connect components. module top( input wire [3:0] A, input wire [3:0] B, input wire [3:0] C, input wire [3:0] D, output wire [3:0] result); wire [3:0] mult1_out; wire [3:0] mult2_out; mult u1 (A, B, mult1_out); mult u2 (C, D, mult2_out); add u3 (mult1_out, mult2_out, result); endmodule Review Questions 1. If I have a * and + box, how would I use schematic representation to draw A*B+C*D? 2. What does @* mean? 3. In binary, how would you write 6 d14? 4. Write a top module which uses mult and add to find (A+B)*(C+D) 5. What are u1, u2, etc? 6. At the end of lecture, I claimed I could reorder the mults and add. Why doesn t order matter here?

Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 2 of 5 Tri-state devices One other thing that will be useful to us is a tri-state device. Basically, what this is, is a device that let s us disconnect a wire it s in effect a switch. The standard symbol can be seen to the right. Basically speaking, if C is a 1 then out=in. If C is a 0 then out is connected to nothing at all. The truth table is seen below. C in out C in out 0 0 Not connected 0 1 Not connected 1 0 0 1 1 1 Draw a schematic which uses tristate devices and a NOT to implement the following: if(x=1) Y=A else Y=B Administrative break Your TC2 assignment is due on January 26 th. It s a memo about ideas on educational toys. Class grade comments o You may have noticed that the class is graded out of 1000 points total (230 for the project, 200 for the final, 10 for lab 1, 20 for your TC2 memo, etc.) o It is worth noting that there isn t a limit on how many people can get each grade. We will grade straight-scale. So if you are in the 90s you ll get an A of some sort (A+, A, A-). If you are in the 80s, you ll get at least a B of some sort, etc. It s possible we ll be more generous than straight scale, but not less generous. Do recall that you need a C (not a C-) to pass. A brief discussion on why TC is important I need to get everyone s pictures I didn t get the first time. o Still working on names. I m slow

Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 3 of 5 Sequential Logic So far, we ve only used combinational logic. To remind you, that means that the output of the device is determined solely by the current inputs. Look at the tri-state truth table above. If you know the inputs, you know the output. Sequential logic allows for memory. That is, we can store data and the output of the device depends upon what is being stored. As we discussed before, we generally use the term register to indicate a device that stores data. Register Write This device will output (on ) the last value written to it. So how do you write to it? It requires two things to happen. 1. Write must be a 1 2. must be a rising edge Say that Data for the above register is 4 bits in size (both and ). Say starts at 4 b0101. What would be? 4 b1111 4 b0000 4 b1001 Write There are a lot of things going on here. The above is a timing diagram. It shows how things change over time. Generally the x-axis would have some amount of time listed (maybe 1ns per dashed line) We are seeing a clock for the first time. Generally speaking clocks will be periodic (as shown above) with some frequency. Your home computer probably uses a 2 to 3 GHz clock for the logic in its processor. Generally speaking, registers will only change on the rising edge of clock. I m showing a 4-bit bus here in a fairly typical way. When the data changes, I just show the new value.

Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 4 of 5 Memories If you think about a register as a variable (which is a fine analogy) then memories are arrays. You can select which register you want (called the address) and that s the one that you can read or change. Register 0 Register 1 Register 2 Register 3 Register 4 Register 5 Register 6 Register 7 Address_in Address_write Mem_write Memory Memory Address Register What s going on here is that I have two separate devices: the memory address register and the memory itself. If I want to read from register 3, I first have to write a 3 to the memory address register (using Address_in, Address_write, and clock). Until I again change the memory address register, I ll be reading and writing only from register 3. 1. If there are 8 registers in this memory, how many bits do I need for Address_in? 2. If each register were 6 bits wide, how many bits do I need for data_in and data_out? 3. Assuming both of the above are true, how many bits of storage (not including the Memory Address Regsiter) does this memory need? What if I included the memory address register in that calculation? And That s it. Amazingly, that s all the building blocks we ll need to implement any general algorithm including a computer. Just combinational logic (including tri-states), registers, memories (which is really just an array of registers and a way to select an element) and wires!

Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 5 of 5 (Bonus page) Adding numbers as an example of combinational logic 1 Below, in figures 1 and 2, we have a LOT of things going on at once. We ve designed a circuit which we claim will add two 4-bit numbers. We ll use the notation A[3:0] to indicate the bus that is made up of A 3, A 2, A 1, and A 0. We ll use B[3:0], S[3:0] and C[4:0] in a similar way. Let s assume C 0 =0, A[3:0]=0100 and B[3:0]=0110. That is we are performing: 0100 + 0110 + ======= ======= What is the base-10 equivalent of the addition on the left? For the above addition, what are the values of: S[3:0] C[4:0] Figure 1: Full adder Figure 2: Ripple Carry Adder. S is Sum and C is Carry! A[3:0] B[3:0] 4-bit adder S[3:0] C 0 Figure 3: 4-bit adder Here we are working at a number of levels of abstraction. We ve built a 1-bit full adder out of gates and then built a 4-bit adder out of those 1-bit adders. We could just use a 4-bit adder and not worry at all about how the adder was built (in fact there are better ways to build an adder!). Instead we just need to know how the device works. In Verilog, we could just use a + instead, but sometimes we want to control the implementation and so we might do it this way. Can you create the full adder and 4-bit ripple carry adder in Verilog as we did the multiply-add circuit above? 1 Figure for full adder from http://robey.lag.net/2012/11/07/how-to-add-numbers-1.html. Figure for RCA from https://en.wikipedia.org/wiki/adder_(electronics)