Skip to content

Latest commit

 

History

History

Day-29

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

In this Verilog module:

  1. queue is an array of 4 registers, representing the LIFO queue. Each register holds 8 bits of data.
  2. top is a 2-bit register used to keep track of the top element in the queue.
  3. The always block is sensitive to the rising edge of the clock signal and the reset signal.
  4. When the reset signal is asserted (reset is high), it clears the top pointer and sets all elements in the queue to zero.
  5. When the push signal is asserted (push is high), it checks if there is space in the queue (top < 2'b11) and increments the top pointer to push data into the queue.
  6. When the pop signal is asserted (pop is high), it checks if there are elements in the queue (top > 2'b00), pops data from the queue, and decrements the top pointer.

This Verilog module represents a basic LIFO queue with a fixed size of 4 elements. You can modify the number of elements or the data width to suit your specific requirements.