2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.

Slides:



Advertisements
Similar presentations
Digital System Design-II (CSEB312)
Advertisements

VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Counters Discussion D8.3.
Verilog in transistor level using Microwind
CPSC 321 Computer Architecture Andreas Klappenecker
CDA 3100 Recitation Week 11.
//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
Verilog.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Sequential Logic in Verilog
Supplement on Verilog adder examples
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
Verilog Modules for Common Digital Functions
CPEN Digital System Design
Table 7.1 Verilog Operators.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
FSM Revisit Synchronous sequential circuit can be drawn like below  These are called FSMs  Super-important in digital circuit design FSM is composed.
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Specifies combinational logic (unclocked) always stmt. should use “=“ (called “blocking” assignment) in comb. logic always statements. RHS just takes output.
FSM examples.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
2-to-1 Multiplexer: if Statement Discussion D2.1 Example 4.
Pulse-Width Modulated DAC
Multiplexers Lecture L6.4 Section 6.4.
Ring Counter Discussion 11.3 Example 32.
Multiplexers Module M6.1 Section 6.4. Multiplexers A 4-to-1 MUX TTL Multiplexer A 2-to-1 MUX.
Arbitrary Waveform Discussion 12.2 Example 34. Recall Divide-by-8 Counter Use q2, q1, q0 as inputs to a combinational circuit to produce an arbitrary.
Counters Discussion 12.1 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
4-to-1 Multiplexer: Module Instantiation Discussion D7.2 Example 5.
A/D Converter Datapaths Discussion D8.4. Analog-to-Digital Converters Converts analog signals to digital signals –8-bit: 0 – 255 –10-bit: 0 – 1023 –12-bit:
Advanced Verilog EECS 270 v10/23/06.
Generic Multiplexers: Parameters Discussion D7.5 Example 8.
Multiplexers Lecture L6.6v Section 6.2. Multiplexers A Digital Switch A 2-to-1 MUX A 4-to-1 MUX A Quad 2-to-1 MUX The Verilog if…else Statement TTL Multiplexer.
Introduction to Verilog Multiplexers. Introduction to Verilog Verilog Hardware Description Language (Verilog HDL) released by Gateway Design Automation.
Top-level Verilog Designs Discussion D9.1 Example 12.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
7-Segment Display DIO1 Board Verilog.
Engineering 100 Section 250 Combinational Logic -- Examples 9/13/2010.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
Figure 6.1. A 2-to-1 multiplexer.
Week Four Design & Simulation Example slides. Agenda Review the tiny example (Minako “logic”)from last week – look at the detailed static timing report.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
Multiplexers Section Topics Multiplexers – Definition – Examples – Verilog Modeling.
Chapter 8: Combinational Logic Modules Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 8-1 Chapter 8: Combinational.
Figure 2.1. A binary switch. x1=x0= (a) Two states of a switch S x (b) Symbol for a switch.
AND Gate Inputs Output Input A (Switch) Input B (Switch) Output Y (Lamp) 0 (Open) 0 (OFF) A B Lamp.
Single Cycle Processor Design using Verilog
1 Modeling Combinational Logic Circuits Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 10: Data-Converter Example Spring 2009 W.
Supplement on Verilog for Algorithm State Machine Chart
Designing Combinational Logic Circuits in Verilog - 1
TODAY’S OUTLINE Verilog Codings Concurrent and Sequential If-else
Reg and Wire:.
Verilog Introduction Fall
The Multiplexer Multi what?
Hasib Hasan Ankit Baingane Edward Hanson
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Function Notation “f of x” Input = x Output = f(x) = y.
مدار منطقی به نام یگانه مهندس هستی مهدی قدیری
Supplement on Verilog combinational circuit examples
Presentation transcript:

2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4

2-to-1 Multiplexer Multiplexers The Verilog if statement

Multiplexers A multiplexer is a digital switch: If s = 0, y = a; if s = 1, y = b

Multiplexers A multiplexer is a digital switch: If s = 0, y = a; if s = 1, y = b

// Example 4a: 2-to-1 MUX using logic equations module mux21a ( input wire a, input wire b, input wire s, output wire y ); assign y = ~s & a | s & b; endmodule

2-to-1 Multiplexer Multiplexers The Verilog if statement

Multiplexers A multiplexer is a digital switch: If s = 0, y = a; if s = 1, y = b if(s == 0) y = a; else y = b; Verilog

// Example 4b: 2-to-1 MUX using if statement module mux21b ( input wire a, input wire b, input wire s, output reg y ); if(s == 0) y = a; else y = b; endmodule

// Example 4c: 2-to-1 MUX using ? notation module mux21c ( input wire a, input wire b, input wire s, output reg y ); assign y = s ? b : a; endmodule Note shortcut if statement