Problems

8. Serial to parallel

EasyWrite the moduleAbout 20 minFree
sequentialshift registercounters

Bits arrive one at a time on din, least significant bit first. A bit is only real on a clock edge where din_valid is 1; edges with din_valid = 0 are ignored.

After every eighth valid bit, put the assembled byte on data and raise data_valid for exactly one clock cycle. data keeps the last complete byte until the next one is finished. Then start collecting the next byte.

rst (synchronous, active high) clears data to 0, data_valid to 0 and forgets any partly collected bits.

Ports

Module deserializer

PortDirBitsWhat it is
clkin1Clock.
rstin1Synchronous reset, active high.
dinin1Serial data, LSB first.
din_validin1din holds a bit on this edge.
dataout8The last complete byte.
data_validout11 for one cycle when a new byte is ready.

Example

Sending 0, 0, 1, 0, 1, 1, 0, 1 (bit 0 first) gives data = 1011_0100 (0xB4) with data_valid = 1 for the cycle after the eighth bit.

Stuck? . Sign in to save your progress. You can solve the free problems without an account.

Verilogdeserializer.v
14px
Loading the editor…

Submit your answer to have it graded. The hidden test runs on the server; you see whether it passes and, if not, the first case it gets wrong.

Serial to parallel: Verilog interview question | breadboardhub