Introduction to Verilog Multiplexers. Introduction to Verilog Verilog Hardware Description Language (Verilog HDL) released by Gateway Design Automation.

Slides:



Advertisements
Similar presentations
VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Advertisements

Verilog in transistor level using Microwind
CPSC 321 Computer Architecture Andreas Klappenecker
Verilog.
The Verilog Hardware Description Language
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
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
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
CPEN Digital System Design
Table 7.1 Verilog Operators.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
7-Segment LED Display DD: Section Mano: Section 3.10.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
Digital System Design by Verilog University of Maryland ENEE408C.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Copyright © 2007 Elsevier4- Chapter 4 :: Hardware Description Languages Digital Design and Computer Architecture David Money Harris and Sarah L. Harris.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
Introduction to VHDL Multiplexers. Introduction to VHDL VHDL is an acronym for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
Logic Design Fundamentals - 2 Lecture L1.2. Logic Design Fundamentals - 2 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Introduction to VHDL Multiplexers Discussion D1.1.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 2 FPGAs & Verilog.
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.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
7-Segment Display DIO1 Board Verilog.
Overview Logistics Last lecture Today HW5 due today
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.
ECE 2372 Modern Digital System Design
Synthesis Presented by: Ms. Sangeeta L. Mahaddalkar ME(Microelectronics) Sem II Subject: Subject:ASIC Design and FPGA.
Digilab2 DIO1 Board. Digilab2 – DIO1 Boards 50 MHz clock mclk Prom socket Spartan IIE.
Verilog HDL: A solution for Everybody By, Anil Kumar Ram Rakhyani
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.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Slide 1 2. Verilog Elements. Slide 2 Why (V)HDL? (VHDL, Verilog etc.), Karen Parnell, Nick Mehta, “Programmable Logic Design Quick Start Handbook”, Xilinx.
Introduction to Combinational Verilog EECS270 rev 9/25/12.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
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.
Introduction to Verilog
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
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.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 A hardware description language is a computer language that is used to describe hardware. Two HDLs are widely used Verilog HDL VHDL (Very High Speed.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
Supplement on Verilog FF circuit examples
TODAY’S OUTLINE Verilog Codings Concurrent and Sequential If-else
Lecture L5.1 Mealy and Moore Machines
Hardware Description Languages: Verilog
TODAY’S OUTLINE Procedural Assignments Verilog Coding Guidelines
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Behavioral Modeling in Verilog
Computer Architecture
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Supplement on Verilog adder examples
The Verilog Hardware Description Language
Foundations for Datapath Design
Introduction to Verilog – Part-2 Procedural Statements
Presentation transcript:

Introduction to Verilog Multiplexers

Introduction to Verilog Verilog Hardware Description Language (Verilog HDL) released by Gateway Design Automation in 1983 Cadence buys Gateway in 1989 Cadence releases Verilog HDL to the public domain in 1990 Verilog adopted by the IEEE as IEEE standard 1364 in 1995

Combinational Circuit Example n-line 2-to-1 Multiplexer n-line 2 x 1 MUX a(n-1:0) b(n-1:0) y(n-1:0) sel sel y 0 a 1 b

An n-line 2 x 1 MUX a(n-1:0) b(n-1:0) y(n-1:0) sel n-line 2 x 1 MUX module mux2p(a,b,sel,y); parameter width = 2; input [width-1:0] a; input [width-1:0] b; input sel; output [width-1:0] y; reg [width-1:0] y; a, b) begin if(sel == 0) y = a; else y = b; end endmodule parameter statement defines width of bus

module mux2p(a,b,sel,y); parameter width = 2; input [width-1:0] a; input [width-1:0] b; input sel; output [width-1:0] y; reg [width-1:0] y; a, b) begin if(sel == 0) y = a; else y = b; end endmodule module name always sensitivity list Sequential statements (if…else) must be in an always block Note optional begin…end in always block An n-line 2 x 1 MUX reg defines y as a variable

module mux2p(a,b,sel,y); parameter width = 2; input [width-1:0] a; input [width-1:0] b; input sel; output [width-1:0] y; reg [width-1:0] y; a, b) begin if(sel == 0) y = a; else y = b; end endmodule Note: = is a blocking assignment An n-line 2 x 1 MUX Note: == is logical equality operator

Digilab2 – DIO1 Boards Spartan II FPGA 8 LEDs LD 8 Switches SW 4 Pushbuttons BTN Four 7-segment displays Pushbutton bn 74HC373 latch ldg <= ‘1’

Top-level Design – Lab 1

module Lab1v(SW,BTN4,ldg,LD); input [1:8] SW; input BTN4; output ldg; output [1:4] LD; mux2p SWmux(.a(SW[1:4]),.b(SW[5:8]),.sel(BTN4),.y(LD)); defparam SWmux.width = 4; assign ldg = 1; // enable 74HC373 latch endmodule

module Lab1v(SW,BTN4,ldg,LD); input [1:8] SW; input BTN4; output ldg; output [1:4] LD; mux2p SWmux(.a(SW[1:4]),.b(SW[5:8]),.sel(BTN4),.y(LD)); defparam SWmux.width = 4; assign ldg = 1; // enable 74HC373 latch endmodule

module Lab1v(SW,BTN4,ldg,LD); input [1:8] SW; input BTN4; output ldg; output [1:4] LD; mux2p SWmux(.a(SW[1:4]),.b(SW[5:8]),.sel(BTN4),.y(LD)); defparam SWmux.width = 4; assign ldg = 1; // enable 74HC373 latch endmodule Note: assign statement used for concurrent logic equations Note: defparam statement used to override parameter width

An n-line 4 x 1 multiplexer a(n-1:0) b(n-1 :0) y(n-1 :0) sel(1:0) n-line 4 x 1 MUX c(n-1 :0) d(n-1 :0) Sely “00”a “01”b “10”c “11”d

An n-line 4 x 1 multiplexer module mux4p(a,b,c,d,sel,y); parameter width = 4; input [width-1:0] a,b,c,d; input [1:0] sel; output [width-1:0] y; reg [width-1:0] y; a, b, c, d) case(sel) 0: y = a; 1: y = b; 2: y = c; 3: y = d; default: y = a; endcase endmodule Must include ALL posibilities in case statement Signals can have values 0, 1, z, x sely “00”a “01”b “10”c “11”d Note: default is decimal

module Lab1bv(SW,BTN,ldg,LD); input [1:8] SW; input [1:2] BTN; output ldg; output [1:2] LD; mux4p SWmux(.a(SW[1:2]),.b(SW[3:4]),.c(SW[5:6]),.d(SW[7:8]),.sel(BTN),.y(LD)); defparam SWmux.width = 2; assign ldg = 1; // enable 74HC373 latch endmodule Top-level design

Verilog Always Block ) begin end Within an always block: Variables (reg) are assigned using = (Blocking) and are updated immediately. (Used for combinational signals) Sequential signals are assigned using <= (Non-blocking) and are updated at the end of the always block.