CS 61C Discussion 10 (1) Jaein Jeong Fall 2002 2-input MUX °Out = in0 * select’ + in1 * select in0in1selectout 0000 0010 0100 0111 1001 1010 1101 1111.

Slides:



Advertisements
Similar presentations
//HDL Example 8-2 // //RTL description of design example (Fig.8-9) module Example_RTL (S,CLK,Clr,E,F,A);
Advertisements

Counters Discussion D8.3.
Verilog in transistor level using Microwind
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 Descriptions of Digital Systems
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Verilog Modules for Common Digital Functions
Table 7.1 Verilog Operators.
COE 405 Design and Synthesis of DataPath Controllers Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Originally designed to model and verify a design.
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Half Adder ( / ) Structural description: Data flow description:
Pulse-Width Modulated DAC
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Verilog Module Module declaration Module instantiation module Add_full (sum, c_out, a, b, c_in); // parent module input a, b, c_in; output c_out, sum;
CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Ring Counter Discussion 11.3 Example 32.
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.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
//HDL Example 3-3 // //Stimulus for simple circuit module stimcrct; reg A,B,C; wire x,y; circuit_with_delay swd(A,B,C,x,y);
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:
Registers and Shift Registers Discussion D8.2. D Flip-Flop X 0 Q 0 ~Q 0 D CLK Q ~Q D gets latched to Q on the rising edge of the clock. Positive.
Generic Multiplexers: Parameters Discussion D7.5 Example 8.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
Engineering 100 Section 250 Combinational Logic -- Examples 9/13/2010.
RTL Coding tips Lecture 7,8 Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
CS 61C L4.2.2 Verilog II (1) K. Meinz, Summer 2004 © UCB CS61C : Machine Structures Lecture Verilog II Kurt Meinz inst.eecs.berkeley.edu/~cs61c.
Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog.
1 Lecture 12 Time/space trade offs Adders. 2 Time vs. speed: Linear chain 8-input OR function with 2-input gates Gates: 7 Max delay: 7.
BR 8/991 Combinational Building Blocks 2/1 Multiplexor (MUX) I0 I1 Y S if S = 0, then Y = I0 if S = 1, then Y = I1 Y = I0 S’ + I1 S I0 I1 Y S A[3:0] B[3:0]
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Digital Electronics.
Introduction to Verilog. Data Types A wire specifies a combinational signal. – Think of it as an actual wire. A reg (register) holds a value. – A reg.
Introduction to Verilog
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles.
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 7 – Part 2.
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
Digital System Design Verilog ® HDL Dataflow Modeling Maziar Goudarzi.
Hardware Description Languages: Verilog
Combinational Circuits
Digital Electronics Multiplexer
Verilog Modules for Common Digital Functions
ELEN 468 Advanced Logic Design
ECE 4110– Sequential Logic Design
Verilog Introduction Fall
Digital Decode & Correction Logic
Hardware Description Languages: Verilog
Digital Electronics Multiplexer
Unit5 Combinational circuit and instrumentation system.
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Verilog.
6. Registers and Counters
FIGURE 1: SERIAL ADDER BLOCK DIAGRAM
Register-Transfer Level Components in Verilog
The Verilog Hardware Description Language
Presentation transcript:

CS 61C Discussion 10 (1) Jaein Jeong Fall input MUX °Out = in0 * select’ + in1 * select in0in1selectout Structural description module mux (in0,in1,select,out); input in0, in1, select; output out; wire s0, w0, w1; not (s0, select); and (w0, s0, in0), (w1, select, in1); or (out, w0, w1); endmodule // mux w1 w0 select in out s0 Behavioral descriptions module mux (in0,in1,select,out); input in0, in1, select; output out; reg out; if (select) out = in1; else out = in0; endmodule // mux

CS 61C Discussion 10 (2) Jaein Jeong Fall input MUX in0 in2 in1 in3 select0 select1 w0 w1 out Structural description module mux4 (in,select,out); endmodule // mux Behavioral descriptions module mux4 (in,select,out); endmodule // mux

CS 61C Discussion 10 (3) Jaein Jeong Fall 2002 Full Adder °S = A xor B xor Cin °Cout = AB + ACin + BCin Module FA(A, B, Cin, S, Cout); input A, B, Cin; output S, Cout; wire w0, w1, w2; xor3(S, A, B, Cin); and (w0, A, B), (w1, A, Cin), (w2, B, Cin); or3(Cout, w0, w1, w2); endmodule FA CinA B S Cout

CS 61C Discussion 10 (4) Jaein Jeong Fall bit ripple carry adder Write a structural description FA 0 A0B0 S0S1S2S3 w0 A1B1w1A2B2 w2 A3B3 C module add4 (A,B,S,C); endmodule // add4

CS 61C Discussion 10 (5) Jaein Jeong Fall bit register module DFF (CLK,Q,D,RST); input D; input CLK, RST; output Q; reg Q; (posedge CLK) if (RST) Q = 0; else Q = D; endmodule // DFF module mux (in0,in1,select,out); input in0, in1, select; output out; reg out; if (select) out = in1; else out = in0; endmodule // mux Write a structural description. load w0 in w1 DFF RST CLK out module reg1 (in,load,CLK, RST, out); endmodule // dffwe reg1

CS 61C Discussion 10 (6) Jaein Jeong Fall bit shift register module shift4 (in,load,CLK,RST,out); input in, load, CLK, RST; output out; … endmodule // shift4 Write a structural description. reg1 inout load CLK load CLK load CLK load CLK RST w0