Design and verify a 4-bit parallel to serial converter with valid and empty indications
The module should have the following interface:
module Parallel_to_Serial
input wire clk,
input wire reset,
output wire empty_o, // Should be asserted when all of the bits are given out serially
input wire[3:0] parallel_i, // Parallel input vector
output wire serial_o, // Serial bit output
output wire valid_o // Serial bit is valid-
When the circuit is reset, the shift register, count and output registers are cleared, and the
empty_o_regis set to1indicating no data is being transmitted. -
When
countis 0, new parallel data is loaded and serial transmission begins. During this transmission, LSB ofshift_regis set toserial_o. Output is valid hence its set to1, shifting takes place and count is decremented. When transmission is completed, output is made empty.