Concepts to learn:
- Full Adder, Half Adder
- Multiplexer
- Encoder, decoder, priority encoder
There will not be clk,rst in below examples since it is combinational logic.
Common concepts:
Design coding:
- Module with ports, input wire, output reg
- Always block implementing each process
Testbench coding:
- Instantiate design
- No clk, no rst
Questions:
- How hardware differs from software?
- How Verilog implements
- Concept of time
- Concept of structure
- Concept of concurrent process
- Concept of states
- How Verilog language differs from C language?
- Why Verilog is called as Hardware description language, not a programming language?
- What does EDA stand for?
- How EDA tools make the whole VLSI design process easier?
- Half Adder
- Ports
- Input: a, b (8 bit vectors)
- Output: s, co
- Implement half adder logic using assign
- Implement testbench to check the half adder behaviour
- Testbench file name: tb_ha.v
- Use :spl to create a new file tb_ha.v
- Include ha.v in tb_ha.v
- Declare all design inputs as reg
- Copy the same line as in design file, use ‘cw’ command to change input to reg.
- Use yy, y1 commands to copy lines from design file and use ‘p’ to paste in tb file.
- To switch between each file, use ‘Ctrl+w’, followed by up or down arrow
- Create half adder module instance
- Use ctlr+w and arrow to move cursor to ha.v file
- Go to design module definition line(line number 1)
- Use up or down arrow to move the cursor
- yy
- ctrl+w, arrow move to tb_ha.v
- ‘p’ to paste that line in tb_ha.v
- Go to the line below which we want to paste module definition
- Remove module
- Keep cursor on m of the module
- dw
- Drive a, b with random value
- Use $monitor to monitor a, b, s and co
- Implement half adder logic in always block
- Always @(a or b)
- Anytime a or b changes, half adder should work
- Implement half adder using logic gates
- Truth table, K-maps, Boolean expression, circuit, coding
- For a 8 bit input vectors, it’s quite complex
- DO it only using 1 bit half adder and tb also for 1 bit ha.
- Full adder
- Use half adder coded above to implement full adder
- Search how to implement full adder using half adder in google.
- Use ha_gate.v, 1 bit Half adder to do this.
- If this works, see how 8 bit FA can also be implemented.
- Write test bench to check design behaviour
- Multiplexer (8 to 1 mux)
- Implement 8 to 1 mux
- Write testbench to check design behaviour
- Encoder, decoder and priority encoder
- Implement above designs
- Write testbench to check design behaviour
- Encoder, decoder and priority encoder implementation using multiplexer
- Implement above designs using multiplexer
- Write testbench to check design behaviour
- Implementing various gates using multiplexer
- Implement AND, OR, NAND, NOR, XOR, XNOR using multiplexer
- 4×1 Multiplexor using K-Maps
- Implement truth table
- Use K-maps to come up with Boolean expression for 4×1 Multiplexor
- Write the Verilog code using above expression
- Develop testbench and run the simulation.
- Parameterizable full Adder (once parameter concept is taught)
- Same as above except module being parameterizable for width of input and output that half adder supports
10. Implementing a simple gate level design using gate level modeling
- SR latch as example
- Implement below SR latch using Nand gates
- Develop TB for same.
- Run the simulation, compare the Q, QB behavior with respect S, R
- Correlate results with SR latch behavior
- S : set (S=1 => Q should be 1)
- R : reset (R=1 => Q should be 0)