找回密码
 注册
关于网站域名变更的通知
查看: 1094|回复: 1
打印 上一主题 下一主题

大家帮我看看这个VHDL100进制计数器设计的有没有问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2013-11-15 20:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
仿真的时候就是不对。。。7 \8 i1 I& [% F1 b

/ S9 e8 T! ?$ d: a! K4 }- Y0 ?, ]% Y0 C# H6 ~6 ?( l
library ieee;
. L, W4 d4 x. m2 X8 }7 fuse ieee.std_logic_1164.all;. d, E- f: f5 F( M( l
use ieee.std_logic_arith.all;
2 _2 Q( y) O6 Y  J! r! ]/ b) Fuse ieee.std_logic_unsigned.all;& {4 _- X% k* j8 m* g$ t
entity cnt100 is; Y) T2 [0 e  }4 R7 l0 [. x
   port(clk:in std_logic;
# z7 r% E1 p" i7 A              qut std_logic_vector(7 downto 0);
3 f4 _% u) a4 Y+ c                        cut std_logic);" {. q, }( Y! L2 I
end cnt100;
. H' }( {& k8 ~! |7 F% `) A; b( P1 darchitecture one of cnt100 is4 q, u: \" i9 L9 j6 x% v
signal qa:std_logic_vector(3 downto 0);" Y1 ?  S" }( E! ?9 Y2 s
signal qb:std_logic_vector(3 downto 0);
) I& a! ~8 _2 Y4 e  y, X- Ysignal cin:std_logic;
; e' O' \+ e4 t! t( bbegin
! ]! B8 G# N3 D) J4 [   q(3 downto 0)<=qa;
8 f, _; ]& ~( Y( V4 F        q(7 downto 4)<=qb;
4 y$ Q9 W. M& C1 l  v   process(clk)
1 o, E: f8 v0 W  `# W        begin! q1 u1 f4 q0 W7 r5 {% X
           if clk'event and clk='1' then / H. B- X( q' [
                   if qa=9 then qa<="0000";cin<='1';
0 z! y5 C/ \! {7 q8 W( W) u                        else qa<=qa+1;cin<='0';: c4 V3 J  K8 r! u, {
                        end if;
- d3 S$ V- f$ D" f0 G0 [% C                end if;* m& k4 ]: ^9 S9 Z/ C
        end process;
0 J/ ?  {# Q2 e: o1 x, y  U0 j) z        process(clk,cin)
; N2 ]2 G( C. L' R        begin% y! a, \( B2 ^# I4 ^
             if clk'event and clk='1' then
; V. N! W7 A2 h- }* H. l                     if (qb=9 and qa=9) then qb<="0000";c<='1';9 W5 @: N  \. |- W* R% s+ D9 U+ t
                          else c<='0';
4 @* k$ A+ O- b& o0 R' T: _                          end if;
3 |$ F$ P6 ^+ W5 Y. m' [% I                          if cin='1' then qb<=qb+1;
! h/ Y- s5 X; X$ Y6 l3 s' ]' U                          end if;- Y4 N. u) _% d$ j  ^
                        end if;
0 I+ J6 A4 ^$ Q/ L- y% Y        end process;
3 `6 P  h$ q5 M8 Vend one;

该用户从未签到

2#
发表于 2013-12-19 10:48 | 只看该作者
出在第二个process里面。。qb=9 and qa=9时已经进位了且qb<="0000"。。cin没有清零
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-7-21 20:13 , Processed in 0.125000 second(s), 24 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表