CSE460-03L Assignment-1
CSE460-03L Assignment-1
VLSI DESIGN
CSE460
Lab Assignment 1, Section 3
Fall 2024
Marks:
Objective:
The goal of this task is to design a 4-bit up/down counter in Verilog, write the Verilog code, and
validate its functionality through simulation.
Specifications:
1. Inputs:
○ R [3:0]: A parallel load input. This represents the value to be loaded into the
counter when the load signal is active.
○ Resetn: An asynchronous reset signal. When this signal is low (Resetn = 0),
the counter is reset to 0.
○ Clock: A clock signal to drive the counter operations.
○ E: An enable signal. When this signal is high (E = 1), the counter is enabled for
counting.
○ L: A load signal. When this signal is high (L = 1), the value of R is loaded into
the counter.
○ up_down: A control signal to determine the counting direction:
■ up_down = 1: The counter counts up.
■ up_down = 0: The counter counts down.
2. Outputs:
○ Q [3:0]: The current value of the counter.
3. Behavior:
○ When Resetn = 0: The counter is reset asynchronously to 0.
○ When L = 1: The counter loads the value of R into Q on the rising edge of the
clock.
○ When L = 0 and E = 1:
■ If up_down = 1: The counter counts up on the rising edge of the clock.
■ If up_down = 0: The counter counts down on the rising edge of the
clock.
Task Requirements:
Suppose you have 4 sensors. Based on the input from these sensors, you must build 5
separate functions.
Task Requirements:
1. Find the expressions for each function. You can use K-map or Boolean.
2. Write a verilog code to implement the functions. You are only allowed to use one input
variable and one output variable. [Hint: Look into arrays]
3. Generate the timing diagram for the functions. Make sure to show all possible cases.
Submit a pdf file that contains all the requirements for both tasks.