CprE 281: Digital Logic

Similar documents
CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

CprE 281: Digital Logic

More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6

CENG 241 Digital Design 1

Encapsulation. Administrative Stuff. September 12, Writing Classes. Quick review of last lecture. Classes. Classes and Objects

Announcements. Chapter 2 - Part 1 1

Anatomy of a Method. HW3 is due Today. September 15, Midterm 1. Quick review of last lecture. Encapsulation. Encapsulation

1 ( 10 points) 6 min.

ALLIANCE FRANCAISE DE CHANDIGARH DELF A1: MONDAY 8 DECEMBRE 2014 INSTRUCTIONS

Fundamentals of Digital System Design ECE 3700, CPSC 3700

Hardware Description Languages (HDLs) Verilog

Digital Integrated Circuits

ESET 349 Microcontroller Architecture, Fall 2018

EECE 321: Computer Organization

ECE 156A - Syllabus. Description

Many ways to build logic out of MOSFETs

EE324: Microcontrollers and Interfacing. Office Hours: Mon, Wed, to 11.30am. Microcontrollers and Interfacing

Digital Circuits ECS 371

CS Introduction to Programming Fall 2016

Marshall University MTH 100 Syllabus

Last Name Student Number. Last Name Student Number

Introduction to Computer Systems

Programming with Arrays Intro to Pointers CS 16: Solving Problems with Computers I Lecture #11

Introduction to Computer Systems

Lecture 27: Learning from relational data

CprE 488 Embedded Systems Design. Exam 2 Review

CSci 4211: Introduction to Computer Networks. Time: Monday and Wednesday 2:30 to 3:45 pm Location: Smith Hall 231 Fall 2018, 3 Credits

EECS 270 Midterm Exam

Overview of the Class

CSc 2310 Principles of Programming (Java) Jyoti Islam

More on Arrays CS 16: Solving Problems with Computers I Lecture #13

Introduction to Information Technology ITP 101x (4 Units)

Physics 2660: Fundamentals of Scientific Computing. Lecture 7 Instructor: Prof. Chris Neu

ECE 241F Digital Systems

Introduction to Scientific Computing with C++ Introduction Textbook Assignments Lab Accounts and Software HELLO ADD INTS MANDEL Conclusion

CSC 111 Introduction to Computer Science (Section C)

ECE 448 FPGA and ASIC Design with VHDL. Spring 2018

(More) Fun with Pointers and Linked Lists! CS 16: Solving Problems with Computers I Lecture #17

Lab 3: Standard Combinational Components

WELCOME TO. ENGR 303 Introduction to Logic Design. Hello my name is Dr. Chuck Brown

Introduction to Verilog. Mitch Trope EECS 240 Spring 2004

Developing Web Applications and Services Course Syllabus Fall 2015

CSE140 L. Instructor: Thomas Y. P. Lee January 18,2006. CSE140L Course Info

Introduction to Databases

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

CS 111: Programming Fundamentals II

E40M. An Introduction to Making: What is EE?

CS 151 Midterm. (Last Name) (First Name)

ESET 369 Embedded Systems Software, Fall 2017

Verilog Lab. Two s Complement Add/Sub Unit. TA: Xin-Yu Shi

CSCI 4250/6250 Fall 2013 Computer and Network Security. Instructor: Prof. Roberto Perdisci

Midterm Exam Review. CS 2420 :: Fall 2016 Molly O'Neil

CS 0449 Intro to Systems Software Fall Term: 2181

Figure 1: Verilog used to generate divider

EECE.2160: ECE Application Programming Spring 2017


CS 3270 Mobile Development for Android Syllabus

Disability Resources and Educational Services (DRES)

Web Design Final Exam Study Guide

CSci 4211: Data Communications and Computer Networks. Time: Monday and Wednesday 1 pm to 2:15 pm Location: Vincent Hall 16 Spring 2016, 3 Credits

INF 315E Introduction to Databases School of Information Fall 2015

Physics 2660: Fundamentals of Scientific Computing. Lecture 5 Instructor: Prof. Chris Neu

Course Syllabus. Course Information

Intro. to Computer Network

AIMS FREQUENTLY ASKED QUESTIONS: STUDENTS

Internet Web Technologies ITP 104 (2 Units)

General course information

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

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

CSC258: Computer Organization. Memory Systems

Cadence Capture and PSpice Tutorial

Student Name: University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

CS 241 Data Organization. August 21, 2018

CS251-SE1. Midterm 2. Tuesday 11/1 8:00pm 9:00pm. There are 16 multiple-choice questions and 6 essay questions.

Lab 3 Sequential Logic for Synthesis. FPGA Design Flow.

Weekly Lesson Plans Teacher: Jones Geometry 235

Rochester Institute of Technology Golisano College of Computing and Information Sciences Department of Information Sciences and Technologies

EE 4755 Digital Design Using Hardware Description Languages

Overloading Functions & Command Line Use in C++ CS 16: Solving Problems with Computers I Lecture #6

Strings in Python 1 Midterm#1 Exam Review CS 8: Introduction to Computer Science Lecture #6

Call-by-Type Functions in C++ Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #5

Digital Forensics ITP 375 (3 Units)

CSE140L: Components and Design

Overview of the Class

Introduction to Databases

Wednesday May 30 Thursday May 31 Friday June 1

Advanced Topics in Database Systems Spring 2016

Connect to CCPL

Java Camp Daily Schedule

Elec 326: Digital Logic Design

GreenThumb Garden Registration

Get Started with Blackboard For Instructors

Dr. Angela Guercio Dr. Natalia Dragan. Spring 2011

PRELAB! Read the entire lab, and complete the prelab questions (Q1-Q3) on the answer sheet before coming to the laboratory.

January 2013 June 2013

VISN1111 GEOMETRICAL AND PHYSICAL OPTICS

Instructors. ECE 152 Introduction to Computer Architecture. Undergrad Teaching Assistants. Course Website. Textbook.

Biochemistry I: Biomolecules and an Introduction to Metabolic Energy MBIO2360/CHEM2360: A01 Summer 2015: 3 credit hours

Transcription:

CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/

Intro to Verilog CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev

Administrative Stuff HW3 is due on Monday Sep 11 @ 4p

Administrative Stuff HW4 is out It is due on Monday Sep 18 @ 4pm. Please write clearly on the first page (in BLOCK CAPITAL letters) the following three things: Your First and Last Name Your Student ID Number Your Lab Section Letter Also, please Staple your pages

Administrative Stuff TA Office Hours: 5:00 pm - 6:00 pm on Tuesdays (Vahid Sanei-Mehri) Location: 3125 Coover Hall 11:10 am-1:10 pm on Wednesdays (Siyuan Lu) Location: TLA (Coover Hall - first floor) 5:00 pm - 6:00 pm on Thursdays (Vahid Sanei-Mehri) Location: 3125 Coover Hall 10:00 am-12:00 pm on Fridays (Krishna Teja) Location: 3214 Coover Hall

Midterm Exam #1 Administrative Stuff When: Friday Sep 22. Where: This classroom What: Chapter 1 and Chapter 2 plus number systems The exam will be open book and open notes (you can bring up to 3 pages of handwritten notes). More details to follow.

Quick Review

2-1 Multiplexer (Definition) Has two inputs: x 1 and x 2 Also has another input line s If s=0, then the output is equal to x 1 If s=1, then the output is equal to x 2

Graphical Symbol for a 2-1 Multiplexer s x 1 x 2 0 1 f [ Figure 2.33c from the textbook ]

Let s Derive the SOP form s x 1 x 2 s x 1 x 2 s x 1 x 2 s x 1 x 2 f (s, x 1, x 2 ) = s x 1 x 2 + s x 1 x 2 + s x 1 x 2 + s x 1 x 2

Let s simplify this expression f (s, x 1, x 2 ) = s x 1 x 2 + s x 1 x 2 + s x 1 x 2 + s x 1 x 2 f (s, x 1, x 2 ) = s x 1 (x 2 + x 2 ) + s (x 1 +x 1 )x 2 f (s, x 1, x 2 ) = s x 1 + s x 2

Circuit for 2-1 Multiplexer x 1 s s x 2 f x 1 x 2 0 1 f (b) Circuit (c) Graphical symbol f (s, x 1, x 2 ) = s x 1 + s x 2 [ Figure 2.33b-c from the textbook ]

Analogy: Railroad Switch http://en.wikipedia.org/wiki/railroad_switch]

Analogy: Railroad Switch x 1 x 2 select f http://en.wikipedia.org/wiki/railroad_switch]

Analogy: Railroad Switch x 1 x 2 select f This is not a perfect analogy because the trains can go in either direction, while the multiplexer would only allow them to go from top to bottom. http://en.wikipedia.org/wiki/railroad_switch]

More Compact Truth-Table Representation s x 1 x 2 f (s, x 1, x 2 ) 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 (a) Truth table s 0 1 f (s, x 1, x 2 ) x 1 x 2 [ Figure 2.33 from the textbook ]

4-1 Multiplexer (Definition) Has four inputs: w 0, w 1, w 2, w 3 Also has two select lines: s 1 and s 0 If s 1 =0 and s 0 =0, then the output f is equal to w 0 If s 1 =0 and s 0 =1, then the output f is equal to w 1 If s 1 =1 and s 0 =0, then the output f is equal to w 2 If s 1 =1 and s 0 =1, then the output f is equal to w 3 We ll talk more about this when we get to chapter 4, but here is a quick preview.

Graphical Symbol and Truth Table [ Figure 4.2a-b from the textbook ]

The long-form truth table [http://www.absoluteastronomy.com/topics/multiplexer]

4-1 Multiplexer (SOP circuit) [ Figure 4.2c from the textbook ]

Using three 2-to-1 multiplexers to build one 4-to-1 multiplexer s 1 s 0 w 0 w 1 0 1 0 1 f w 2 w 3 0 1 [ Figure 4.3 from the textbook ]

Analogy: Railroad Switches http://en.wikipedia.org/wiki/railroad_switch]

Analogy: Railroad Switches w 0 w 1 w 2 w 3 s 1 f http://en.wikipedia.org/wiki/railroad_switch]

Analogy: Railroad Switches w 0 w 1 w 2 w 3 s 0 these two switches are controlled together s 1 f http://en.wikipedia.org/wiki/railroad_switch]

Using three 2-to-1 multiplexers to build one 4-to-1 multiplexer

Using three 2-to-1 multiplexers to build one 4-to-1 multiplexer w 0 s 1 s 0 w 1 w 2 f w 3

That is different from the SOP form of the 4-1 multiplexer shown below, which uses fewer gates

16-1 Multiplexer s 0 s 1 w 0 w 3 w 4 s 2 s 3 w 7 f w 8 w 11 w 12 w 15 [ Figure 4.4 from the textbook ]

[http://upload.wikimedia.org/wikipedia/commons/2/26/sunsettrackscrop.jpg]

7-Segment Display Example

Display of numbers [ Figure 2.34 from the textbook ]

Display of numbers

Display of numbers a = s 0 c = s 1 e = s 0 g = s 1 s 0 b = 1 d = s 0 f = s 1 s 0

Intro to Verilog

Created in 1983/1984 History Verilog-95 (IEEE standard 1364-1995) Verilog 2001 (IEEE Standard 1364-2001) Verilog 2005 (IEEE Standard 1364-2005) SystemVerilog SystemVerilog 2009 (IEEE Standard 1800-2009).

HDL Hardware Description Language Verilog HDL VHDL

Verilog HDL!= VHDL These are two different Languages! Verilog is closer to C VHDL is closer to Ada

[ Figure 2.35 from the textbook ]

Hello World in Verilog [http://en.wikipedia.org/wiki/verilog]

The Three Basic Logic Gates x x x 1 x x 1 x 2 2 x 1 x x 1 + x 2 2 NOT gate AND gate OR gate You can build any circuit using only these three gates [ Figure 2.8 from the textbook ]

How to specify a NOT gate in Verilog x x NOT gate

How to specify a NOT gate in Verilog we ll use the letter y for the output x y NOT gate

How to specify a NOT gate in Verilog x y not (y, x) NOT gate Verilog code

How to specify an AND gate in Verilog x 1 f= x x 1 x 2 2 and (f, x1, x2) AND gate Verilog code

How to specify an OR gate in Verilog x 1 f= x x 1 + x 2 2 or (f, x1, x2) OR gate Verilog code

2-1 Multiplexer [ Figure 2.36 from the textbook ]

Verilog Code for a 2-1 Multiplexer [ Figure 2.36 from the textbook ] [ Figure 2.37 from the textbook ]

Verilog Code for a 2-1 Multiplexer [ Figure 2.36 from the textbook ] [ Figure 2.40 from the textbook ]

Verilog Code for a 2-1 Multiplexer [ Figure 2.36 from the textbook ] [ Figure 2.42 from the textbook ]

Verilog Code for a 2-1 Multiplexer [ Figure 2.36 from the textbook ] [ Figure 2.43 from the textbook ]

Another Example

Let s Write the Code for This Circuit [ Figure 2.39 from the textbook ]

Let s Write the Code for This Circuit module example2 (x1, x2, x3, x4, f, g, h); input x1, x2, x3, x4; output f, g, h; endmodule and (z1, x1, x3); and (z2, x2, x4); or (g, z1, z2); or (z3, x1, ~x3); or (z4, ~x2, x4); and (h, z3, z4); or (f, g, h); [ Figure 2.39 from the textbook ] [ Figure 2.38 from the textbook ]

Let s Write the Code for This Circuit module example4 (x1, x2, x3, x4, f, g, h); input x1, x2, x3, x4; output f, g, h; endmodule assign g = (x1 & x3) (x2 & x4); assign h = (x1 ~x3) & (~x2 x4); assign f = g h; [ Figure 2.39 from the textbook ] [ Figure 2.41 from the textbook ]

Yet Another Example

A logic circuit with two modules [ Figure 2.44 from the textbook ]

The adder module [ Figure 2.12 from the textbook ]

The adder module [ Figure 2.45 from the textbook ]

The display module a = s 0 c = s 1 e = s 0 g = s 1 s 0 b = 1 d = s 0 f = s 1 s 0

The display module a = s 0 b = 1 c = s 1 d = s 0 e = s 0 f = s 1 s 0 g = s 1 s 0 [ Figure 2.46 from the textbook ]

Putting it all together

Questions?

THE END