HDLBits网址:https://hdlbits.01xz.net/wiki/Main_Page
题目
Now that you have a state machine that will identify three-byte messages in a PS/2 byte stream, add a datapath that will also output the 24-bit (3 byte) message whenever a packet is received (out_bytes[23:16] is the first byte, out_bytes[15:8] is the second byte, etc.).
Module Declaration
module top_module( input clk, input [7:0] in, input reset, // Synchronous reset output [23:0] out_bytes, output done);
我的设计
其实就是在上一篇文章的基础上加上datapath,该datapath将在接收到数据包时也输出24位(3字节)消息(out_bytes [23:16] 是第一个字节,out_bytes [15:8]是第二个字节,依此类推)。
done有效的时候要输出接受数据,即done信号置1和datapath输出同时发生,但是在done状态下有可能输