Module
REGN NO.: LEVEL: Code:
CHIP DESIGN ASSOCIATE (O LEVEL) PR 2
Q1. Design a parameterized N-bit adder in Verilog using a parameter for bit-
width and verify its functionality for 4-bit and 8-bit cases.
(25)
Q2. Design a 4-to-2 priority encoder using Verilog HDL.
• The encoder should take a 4-bit input (in[3:0]) where in[3] has the
highest priority and in[0] the lowest.
• Output a 2-bit binary code (out[1:0]) representing the position of
the highest-priority asserted input.
• If no inputs are high, output should be 00.
(25)
Q3. Write Verilog code for a D Flip-Flop with an asynchronous active-high reset.
The flip- flop should sample the input D on the rising edge of the clock clk,
and reset the output Q to 0 immediately when the reset rst is asserted.
Verify the design by performing both behavioral and post-synthesis
simulations, and confirm the flip-flop behaves correctly in both cases.
(30)
-------oooo-------
__________
O LEVEL/PR-2 Page 2 Set-01/01-26