Outputting a bitstream onto a pin in verilog

Discussion in 'Embedded Systems and Microcontrollers' started by AK 47, Jun 23, 2014.

  1. AK 47

    Thread Starter New Member

    Jun 23, 2014
    1
    0
    I need to output a 32bit bit-stream onto a pin in verilog. I know verilog has the streaming operators pack and unpack but I do not believe they will do what I want it to do.

    I have 32x512 FIFO RAM in which data is stored. Data for the variable "I" stored on the first 32 bits and the data for variable "Q" is stored on the next 32 bits (the rest of FIFO saves data in this alternating fashion). I need to continually get a 32bit stream off the FIFO RAM and output the 32bit data stream onto a pin. My FIFO has three output signals(a signal for the 32 bit data stream(32_data), a signal to say when the FIFO is empty (32_empty), and a signal to say when the FIFO is full(32_full)) My sudo code is the following (It's sudo code because I know how to do everything else but the part I need help with and I wanted to keep it simple for understanding):

    Code ( (Unknown Language)):
    1.  
    2.     process @ posedge clock
    3.     begin
    4.       if (32_empty != 1) then //if the FIFO has data
    5.         if (32_full == 1) then //if the FIFO is full, then we lose data (for testing purposes to know if I need to make the RAM bigger
    6.            PIN_1 <= 1; //output onto a pin that the FIFO is full
    7.            PIN_2 <= 0; //clear pin 2 from outputting data for "I"
    8.            PIN_3 <= 0; //clear pin 3 from outputting data for "Q"
    9.         else if (en_Q == 0)
    10.            (stream 32bit data for variable "I" onto pin 2) //variable "I" output//HELP-This is where I need help figuring out how to stream the output, 32_data, onto a pin
    11.            en_Q <= ~en_Q; // toggle en_Q so next 32bit stream will be for "Q"
    12.         else if (en_Q ==1)
    13.            (stream 32bit data for variable "Q" onto pin 3) //variable "Q" output//HELP-This is where I need help figuring out how to stream the output, 32_data, onto a pin
    14.            en_Q <= ~en_Q; // toggle en_Q so next 32bit stream will be for "I"
    15.     end                
    16.  
    If you could help me with figuring out how to stream a 32 bit data stream onto a pin, that would be great!
    Thanks in advance
     
Loading...