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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x
仿真的时候就是不对。。。
) h5 T, h$ Z$ C3 z- s3 a; h0 \
* J  i9 I6 Y; t$ Z8 _# I8 C1 a, h1 n: {5 @5 s; j' H2 j
library ieee;
. M; C; ^4 R- ^; [; a+ ?use ieee.std_logic_1164.all;
3 [! C1 U, Z$ b, @& s- I% Z) [% Muse ieee.std_logic_arith.all;2 P. K- i, H& }$ `, {
use ieee.std_logic_unsigned.all;
$ S! x! W. F: f* r+ a4 Qentity cnt100 is; y6 ?* }) G1 A6 \
   port(clk:in std_logic;( ]3 E! [5 f$ ~4 q- ?$ E/ ~
              qut std_logic_vector(7 downto 0);1 {' h1 j& e( W7 r
                        cut std_logic);6 ?9 L9 J( o1 D1 ^# f) ]% [7 V2 f( @
end cnt100;7 j2 X' k1 ]0 _/ k$ u3 o
architecture one of cnt100 is
5 T6 A* b7 A$ F4 fsignal qa:std_logic_vector(3 downto 0);
3 x5 Z* D; b; C/ {7 W* `9 o( Esignal qb:std_logic_vector(3 downto 0);
+ _$ G, S* T% |9 ]6 isignal cin:std_logic;0 r8 P8 O' A  G
begin
6 V) l# Y4 J7 Z   q(3 downto 0)<=qa;
( ]/ \0 h5 D7 K  I+ l        q(7 downto 4)<=qb;) @0 o! y3 s* Z7 h" @$ P
   process(clk)
+ x  K1 M; R* D+ b7 u% v* g! K        begin
" N' F" P$ n; @           if clk'event and clk='1' then
$ N, b0 `8 @2 ~3 I0 P                   if qa=9 then qa<="0000";cin<='1';3 F/ g+ q( a; T
                        else qa<=qa+1;cin<='0';
8 r" {5 v; T1 O                        end if;
% |- S4 j3 F4 L. q4 y                end if;
: p' d" i" l/ B( X- x        end process;
% f8 L& a) w2 G2 Z0 v& V        process(clk,cin)
- }7 K% z- N5 G        begin- c! g% s: L! N9 U/ ^/ Y
             if clk'event and clk='1' then6 I. h! o  H, O# O) N) Y
                     if (qb=9 and qa=9) then qb<="0000";c<='1';8 g3 E5 X. y% T
                          else c<='0';
7 i& r- p  }3 V; _$ r+ t                          end if;
: _. H' p  |; D                          if cin='1' then qb<=qb+1;) z0 v3 n# [4 k( {9 B  H
                          end if;3 }0 ?9 k: l: q3 V0 h
                        end if;9 ~4 _4 h& Z, v: o9 p" V/ f
        end process;
6 [& q. _3 P" Y5 |& D$ K+ L2 kend 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-10-31 04:27 , Processed in 0.140625 second(s), 24 queries , Gzip On.

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

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

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