USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL ; ENTITY keys_lock IS PORT ( clk ,clr,status : IN STD_LOGIC ; selout : OUT STD_LOGIC_VECTOR (2 downto 0) ; key : IN STD_LOGIC_VECTOR (3 downto 0) ; segout : OUT STD_LOGIC_VECTOR (0 TO 6);
程序可行library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity mudecoder is port(binaryin:in std_logic_vector(1 to 5); --5位二进制码的输入端口 bcdout1:out std_logic_vector(1 to 7); --七段译码器输出端口 bcdout2:out
用lex与yacc构造汇编器vasm及其指令模拟器vsim vasm及vsim源于Designing Digital Computer Systems with Verilog一书中定义的VeSPA(一个小型的RISC指令集的CPU)的指令集。 vasm通过两遍扫描的方式将VeSPA的汇编程序翻译为机器指令。 vsim模拟CPU的取指->译码->执行的循环完成机器指令的逐条执行,直到遇到停机或者运行时错误为止。 阅读及DIY该代码,你将深入理解并学会:1.两遍扫描的汇编器的工作原理