简易计算器eda技术课程设计内容摘要:
keys IS PORT ( clk : IN STD_LOGIC。 rst : IN STD_LOGIC。 row : IN STD_LOGIC_VECTOR(3 downto 0)。 col : OUT STD_LOGIC_VECTOR(3 downto 0)。 scancode : OUT STD_LOGIC_VECTOR(15 downto 0) )。 END keys。 ARCHITECTURE keys_architecture OF keys IS signal current_state,next_state:std_logic_vector(1 downto 0)。 signal enable:std_logic。 BEGIN process(clk,rst,enable) begin if rst=39。 139。 then current_state=00。 . . elsif clk39。 event and clk=39。 139。 and enable=39。 039。 then current_state=next_state。 end if。 end process。 process(rst,current_state,row) begin if rst=39。 139。 then col=1111。 else case current_state is when 00 = col=1110。 next_state=01。 when 01 = col=1101。 next_state=10。 when 10 = col=1011。 next_state=11。 when 11 = col=0111。 next_state=00。 when others=col=1111。 next_state=00。 end case。 end if。 end process。 . . process(current_state,row) begin if rst=39。 139。 then scancode=X0000。 enable=39。 039。 elsif current_state=00 then case row is when 1110=scancode=X0001。 enable=39。 139。 when 1101=scancode=X0002。 enable=39。 139。 when 1011=scancode=X0004。 enable=39。 139。 when 0111=scancode=X0008。 enable=39。 139。 when others=scancode=X0000。 enable=39。 039。 end case。 elsif current_state=01 then case row is when 1110=scancode=X0010。 enable=39。 139。 when 1101=scancode=X0020。 enable=39。 139。 when 1011=scancode=X0040。 enable=39。 139。 when 0111=scancode=X0080。 enable=39。 139。 when others=scancode=X0000。 enable=39。 039。 end case。 elsif current_state=01 then case row is when 1110=scancode=X0100。 enable=39。 139。 when 1101=scancode=X0200。 enable=39。 139。 when 1011=scancode=X0400。 enable=39。 139。 when 0111=scancode=X0800。 enable=39。 139。 . . when others=scancode=X0000。 enable=39。 039。 end case。 else case row is when 1110=scancode=X1000。 enable=39。 139。 when 1101=scancode=X2020。 enable=39。 139。 when 1011=scancode=X4000。 enable=39。 139。 when 0111=scancode=X8000。 enable=39。 139。 when others=scancode=X0000。 enable=39。 039。 end case。 end if。 end process。 END keys_architecture。 去抖模块程序 LIBRARY ieee。 USE。 ENTITY filter IS PORT ( clk : IN STD_LOGIC。 rst : IN STD_LOGIC。 scancode : IN STD_LOGIC_VECTOR(15 downto 0)。 sc : OUT STD_LOGIC_VECTOR(15 downto 0) )。 . . END filter。 ARCHITECTURE filter_architecture OF filter IS signal count: integer range 0 to 100001。 signal temp: STD_LOGIC_VECTOR(15 downto 0)。 constant G1:integer :=100。 BEGIN process(clk,rst,scancode) begin if rst=39。 139。 then count=0。 elsif clk39。 event and clk=39。 139。 then if scancode=X0000 then count=0。 elsif countG1 then count=count+1。 end if。 end if。 end process。 process(rst,count,scancode) begin if rst=39。 139。 then sc=X0000。 temp=X0000。 else case count is when 0= temp=scancode。 . . when G1= if temp = scancode then sc=temp。 else sc=X0000。 end if。 when others=sc=X0000。 end case。 end if。 end process。 END filter_architecture。 ALU 模块程序 LIBRARY ieee。 USE。 USE。 USE。 ENTITY AUL IS PORT ( op1_in : IN STD_LOGIC_VECTOR(27 downto 0)。 op2_in : IN STD_LOGIC_VECTOR(27 downto 0)。 oprand:IN STD_LOGIC_VECTOR(2 downto 0)。 AUL_OUT : OUT STD_LOGIC_VECTOR(27 downto 0) )。 . . END AUL。 ARCHITECTURE AUL_architecture OF AUL IS BEGIN process(oprand,op1_in,op2_in) variable temp,temp1,temp2 : STD_LOGIC_VECTOR(27 downto 0)。 variable t1,t2:integer range 0 to 268435455。 variable t3:integer range 0 to 268435455。 begin case oprand is when 000 = AUL_OUT=op1_in。 when 001 = temp1:=op1_in。 temp2:=op2_in。 temp:=temp1+temp2。 AUL_OUT=temp。 when 010 = t1:=conv_integer(op1_in)。 t2:=conv_integer(op2_in)。 if t2=t1 then t3:=t2t1。 AUL_OUT=conv_STD_LOGIC_VECTOR(t3,28)。 else AUL_OUT=X8888888。 end if。 . . when 011 = t1:=conv_integer(op1_in)。 t2:=conv_integer(op2_in)。 t3:=t1*t2。 if t3=99999999 then AUL_OUT=conv_STD_LOGIC_VECTOR(t3,28)。 else AUL_OUT=X8888888。 end if。 when 100 = t1:=conv_integer(op1_in)。 t2:=conv_integer(op2_in)。 if t2=0 then AUL_OUT=X8888888。 else t3:=t2/t1。 AUL_OUT=conv_STD_LOGIC_VECTOR(t3,28)。 end if。 when others = AUL_OUT=op1_in。 end case。 end process。 END AUL_architecture。 FSM 模块程序 LIBRARY ieee。 USE。 ENTITY FSM IS PORT ( . . clk : IN STD_LOGIC。 rst : IN STD_LOGIC。 sc : IN STD_LOGIC_VECTOR(15 downto 0)。 op1_add : OUT STD_LOGIC。 op1_clear : OUT STD_LOGIC。 op1_load : OUT STD_LOGIC。 op2_load : OUT STD_LOGIC。 oprand : OUT STD_LOGIC_VECTOR(2 downto 0) )。 END FSM。 ARCHITECTURE FSM_architecture OF FSM IS signal current_state,next_state:STD_LOGIC_VECTOR(2 downto 0):=000。 signal key,number:STD_LOGIC。 signal operate:STD_LOGIC:=39。 039。 signal temp0,temp1:STD_LOGIC_VECTOR(2 downto 0):=000。 BEGIN process(sc) begin case sc is when X0000 =key=39。 039。 number=39。 039。 when X0001 =key=39。 139。 number=39。 039。 / when X0002 =key=39。 139。 number=39。 039。 X when X0004 =key=39。 139。 number=39。 039。 . . w。简易计算器eda技术课程设计
本资源仅提供20页预览,下载后可查看全文
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。
用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。
相关推荐
离合器接合叉加工工艺及端面铣削夹具设计说明书
工方案定为:钻,铰。 槽的加工 查参 考文献 [3]表 可以确定,槽的加工方案为:粗铣 —— 精铣( 7~ 9IT IT ),粗糙度为 Ra ~,设计要求为 和 ,粗铣时,精度可适当降低。 毕业设计说明书论文 1961660126 课件之家的资料精心整理好资料 本 资料 来自 ren ren doc .co m 确定定位基准 粗基准的选择 选择粗基准时
精品毕业论文--燃煤电厂减排co2方案设计
的计算完全忽略了塔内回流量.应用 Aspen Plus建立的模型难以达到物料平衡,因此提出了改进的减压塔模型, 将塔顶部分油返回至塔底渣油,可解决物料平衡的问题,建立了常减压模型。 运用 Aspen Plus模拟软件的灵敏度分析工具可以研究过程参数对常减压产品分布的影响程度,通过工况分析,可以在装置的约束条件范围内确定不同操作条件下的最优化生产方案。 用 Aspen
眼视光技术专业建设方案
能分析渐进多焦点眼镜配戴不适的原因并加以排除 1 能用综 合验光仪对各类疑难屈光不正进行检查 能解决双眼视异常患者的配镜处方 2 能为低视力患者进行屈光检测 开具处方 能试戴和调试眼镜 能使用瞳距尺测定远用、近用瞳距 能开具近视、远视和老视眼的配镜处方 能使用瞳距仪器测定远用、近用瞳距,并能正确测定单侧瞳距 13 开具散光眼的处方 能正确测定瞳高及特殊眼(如瞳孔不等)的瞳距