CPEN Digital System Design

Slides:



Advertisements
Similar presentations
UNIT 2: Data Flow description
Advertisements

Verilog HDL -Introduction
ENEL111 Digital Electronics
Verilog in transistor level using Microwind
//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
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.
Verilog Modules for Common Digital Functions
16/04/20151 Hardware Descriptive Languages these notes are taken from Mano’s book It can represent: Truth Table Boolean Expression Diagrams of gates and.
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.
CPEN Digital System Design Chapter 5 Sequential Circuits Storage Elements and Sequential Circuit Analysis C. Gerousis © Logic and Computer Design.
Hardware Description Languages Drawing of circuit schematics is not practical for circuits containing more than few tens of gates. We need a way to just.
DON’T CARE CONDITIONS Functions that have unspecified output for some input combinations are called incompletely specified functions. Unspecified minterms.
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
CPEN Digital System Design Chapter 9 – Computer Design
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Learning Outcome By the end of this chapter, students are expected to understand a few elementary components in digital system Decoder Multiplexer Demultiplexer.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
CORRECTION Last session, I have made a mistake about two digital coding methods. I explained Hamming code as Grey code mistakenly. Here is correct explanation.
ECE/CS 352 Digital Systems Fundamentals
Hardware Design Environment Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Combinational Logic. Digital Circuits Introduction Logic circuits for digital systems may be combinational or sequential. A combinational circuit.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Verilog HDL: A solution for Everybody By, Anil Kumar Ram Rakhyani
1 Combinational Logic Design Digital Computer Logic Kashif Bashir
CPEN Digital System Design
FPGA-Based System Design Copyright  2004 Prentice Hall PTR Logic Design Process n Functional/ Non-functional requirements n Mapping into an FPGA n Hardware.
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.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Introduction to ASIC flow and Verilog HDL
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Multiplexors Decoders  Decoders are used for forming separate signals for different combination of input signals.  The multiplexer circuit is a digital.
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.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Digital Design Lecture 8 Combinatorial Logic (Continued)
LECTURE V TEST BENCHES. As your projects become more complex and multiple modules are employed, it will no longer be possible to simulate them as we did.
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Combinational Design, Part 2: Procedure. 2 Topics Positive vs. negative logic Design procedure.
Discussion 2: More to discuss
Verilog-HDL-1 by Dr. Amin Danial Asham.
Verilog-HDL-3 by Dr. Amin Danial Asham.
Topics The logic design process..
Chapter 4 Combinational Logic
Hardware Descriptive Languages these notes are taken from Mano’s book
Hardware Description Language
Introduction To Verilog-HDL
Hardware Description Language
FIGURE 4.1 Block diagram of combinational circuit
Levels in computer design
Hardware Descriptive Languages these notes are taken from Mano’s book
HDL Hardware Description Language
فصل چهارم مدارهای ترکیبی.
Hardware Description Language
مدار منطقی به نام یگانه مهندس هستی مهدی قدیری
Hardware Description Language
Chapters 4 – Part3: Verilog – Part 1
Hardware Description Language
COE 202 Introduction to Verilog
Presentation transcript:

CPEN 315 - Digital System Design Digital Circuit Verification Hardware Descriptive Language Verilog C. Gerousis © Logic and Computer Design Fundamentals, 4rd Ed., Mano Prentice Hall

Overview More Structural Verilog Examples Dataflow Modeling Dataflow Verilog Examples Writing Test Bench

4-1 Multiplexer - Structural Verilog Description module multiplexer_4_to_1_st_v(S, I, Y); input [1:0] S; // S is a vector with components S[1] and S[0] input [3:0] I; // I is a 4-bit input; vectors: I[0]…I[3] output Y; wire [1:0] not_S; // connecting NOT-AND wire [0:3] D, N; // D connecting AND-AND not // N  AND outputs gn0(not_S[0], S[0]), // gn0(output, input) gn1(not_S[1], S[1]); and g0(D[0], not_S[1], not_S[0]), g1(D[1], not_S[1], S[0]), g2(D[2], S[1], not_S[0]), g3(D[3], S[1], S[0]), g4(N[0], D[0], I[0]), g5(N[1], D[1], I[1]), g6(N[2], D[2], I[2]), g7(N[3], D[3], I[3]); or go(Y, N[0], N[1], N[2], N[3]); endmodule not_S[0] S[0] D0 g0 N[0] g4

2-to-4 Line Decoder Structural Verilog // 2-to-4 Line Decoder: Structural Verilog Description. // (See Figure 4-10 for logic diagram) module decoder_2_to_4_st_v(EN, A0, A1, D0, D1, D2, D3); input EN, A0, A1; output D0, D1, D2, D3; wire A0_n, A1_n, N0, N1, N2, N3; not go(A0_n, A0), g1(A1_n, A1); and g3(N0, A0_n, A1_n), g4(N1, A0, A1_n), g5(N2, A0_n, A1), g6(N3, A0, A1), g7(D0, N0, EN), g8(D1, N1, EN), g9(D2, N2, EN), g10(D3, N3, EN); endmodule A1_n A0_n N0 g3 N1 N3 g6

Dataflow Verilog Modeling A dataflow description is based on function rather than structure. A dataflow uses a number of operators that act on operands to produce the desired function  Boolean equations are used in place of logic schematics.

4-1 Multiplexer - Dataflow Verilog // 4-to-1 Line Multiplexer: Dataflow Verilog Description (Boolean) // (See Figure 4-14 for logic diagram) module multiplexer_4_to_1_df_v(S, I, Y); input [1:0] S; input [3:0] I; output Y; assign Y = (~ S[1] & ~ S[0] & I[0])| (~ S[1] & S[0] & I[1]) | (S[1] & ~ S[0] & I[2]) | (S[1] & S[0] & I[3]); endmodule

2-to-4 Line Decoder Dataflow Verilog // 2-to-4 Line Decoder with Enable: Dataflow Verilog Desc. // (See Figure 4-10 for logic diagram) module decoder_2_to_4_df_v(EN, A0, A1, D0, D1, D2, D3); input EN, A0, A1; output D0, D1, D2, D3; assign D0 =(EN & ~A1 & ~A0); assign D1 =(EN & ~A1 & A0); assign D2 =(EN & A1 & ~A0); assign D3 =(EN & A1 & A0); endmodule

Writing a Test Bench A test bench in an HDL program for applying stimulus to an HDL design in order to test it and observe the response during simulation. initial begin A = 0; B = 0; // @ t = 0 A and B are set to 0 #10 A = 1; // 10 time units later, A is changed to 1 #20 A = 0; B = 1; // @ t = 30 A is changed to 0 and B to 1 end

Test Bench Example //HDL Example //------------------------------------------ //Gate-level description of a combinational circuit module analysis (A,B,C,F1,F2); input A,B,C; output F1,F2; wire T1,T2,T3,F2not,E1,E2,E3; or g1 (T1,A,B,C); and g2 (T2,A,B,C); and g3 (E1,A,B); and g4 (E2,A,C); and g5 (E3,B,C); or g6 (F2,E1,E2,E3); not g7 (F2not,F2); and g8 (T3,T1,F2not); or g9 (F1,T2,T3); endmodule

Test Bench Example (continued) //Stimulus to analyze the circuit module test_circuit; reg [2:0]D; wire F1,F2; analysis circuit(D[2],D[1],D[0],F1,F2); initial begin D = 3'b000; repeat (7) #10 D = D + 1'b1; end $monitor ("ABC = %b F1 = %b F2 =%b ",D, F1, F2); endmodule