设计题目要求:
 
 本设计基于verilog语言实现,在quartus II下仿真实现:
 
 仿真如下:
 
全部代码如下:
library ieee;
 use ieee.std_logic_arith.all;
 use ieee.std_logic_1164.all;
 use ieee.std_logic_unsigned.all;
entity decoder is --实体说明
 port(datain,clk,clr:IN std_logic;
 dataout:OUT std_logic_vector(4 downto 0); --输入输出端口
 re,we:IN std_logic; --片内ram的读使能和写使能信号 
 clkout:INOUT std_logic;
 wraddress,rdaddress:INOUT std_logic_vector(5 downto 0);
 test : inout std_logic_vector(30 downto 0));–测试端口 5*5
 end decoder;
architecture d1 of decoder is --结构说明
 signal clk_ram,data:std_logic;–ram的读写时钟信号以及输出串行数据



















