Assignment #1 – Combinational logic

Before doing the assignment questions, please get expertise with GVIM.

  1. Half Adder
    1. Ports
      1. Input: a, b (8 bit input)
      1. Output: s, co
    1. Implement half adder logic using assign
    1. Implement testbench to check the half adder behaviour
      1. Testbench file name: tb_ha.v
        1. Use :spl to create a new file tb_ha.v
      1. Include ha.v in tb_ha.v
      1. Declare all design inputs as reg
        1. Copy the same line as in design file, use ‘cw’ command to change input to reg.
          1. Use yy, y1 commands to copy lines from design file and use ‘p’ to paste in tb file.
      1. To switch between each file, use ‘Ctrl+w’, followed by up or down arrow
      1. Create half adder module instance
        1. Use ctlr+w and arrow to move cursor to ha.v file
        1. Go to design module definition line(line number 1)
          1. Use up or down arrow to move the cursor
        1. yy
        1. ctrl+w, arrow move to tb_ha.v
        1. ‘p’ to paste that line in tb_ha.v
          1. Go to the line below which we want to paste module definition
        1. Remove module
          1. Keep cursor on m of the module
          1. dw
      1. Drive a, b with random value
      1. Use $monitor to monitor a, b, s and co
    1. Implement half adder logic in always block
      1. Always @(a or b)
        1. Anytime a or b changes, half adder should work
    1. Implement half adder using logic gates
      1. Truth table, K-maps, Boolean expression, circuit, coding
      1. For a 8 bit input vectors, it’s quite complex
      1. DO it only using 1 bit half adder and tb also for 1 bit ha.
  2. Full adder
    1. Use half adder coded above to implement full adder
      1. Search how to implement full adder using half adder in google.
      1. Use ha_gate.v, 1 bit Half adder to do this.
      1. If this works, see how 8 bit FA can also be implemented.
    1. Write test bench to check design behaviour
  1. Implementing various gates using multiplexer
    1. Implement AND, OR, NAND, NOR, XOR, XNOR using multiplexer
  1. 4×1 Multiplexor using Boolean expression
    1. Write the Verilog code using above expression
    1. Develop testbench and run the simulation.
  1. Implement 1-bit half subtractor
    1. Using above implement 1 bit full subtractor
    1. Using above implement 3 bit full subtractor
  1. Implement 8×1 mux using
    1. 2 – 4×1 Mux
    1. 1 – 2×1 Mux
  1. Implement 1 bit comparator
    1. Behavioral
    1. Data flow
    1. Structural
  1. Implement 2 bit comparator
    1. Behavioral
    1. Data flow
    1. Structural
      1. Using 1 bit comparator
  2. Implement multi bit comparator
    1. Behavioral
    1. Data flow
    1. Structural


  1. How hardware differs from software?
  2. How Verilog implements
    1. Concept of time
    1. Concept of structure
    1. Concept of concurrent process
    1. Concept of states
  3. How Verilog language differs from C language?
  4. Why Verilog is called as Hardware description language, not a programming language?
  5. What does EDA stand for?
  6. How EDA tools make the whole VLSI design process easier?
Course Registration