找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

巢课
电巢直播8月计划
查看: 3065|回复: 1
打印 上一主题 下一主题

求救—谁能帮忙改一改

[复制链接]

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
跳转到指定楼层
1#
发表于 2009-10-31 17:10 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

EDA365欢迎您!

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

x
library ieee;( D0 I" w+ X& x# L! s
use ieee.std_logic_1164.all;: `$ i# [2 W  ~9 x: k! G& w
use ieee.std_logic_arith.all;
% l' |  [6 N+ e6 R0 O9 vuse ieee.std_logic_unsigned.all;
9 P# _/ L# e" ientity hour is- F# a( p' A4 f
port(clk_h,clk_t,tp_h,res_h:in std_logic;
% I0 f0 j* }0 l2 [* X  hset:in std_logic;
! r* A2 W* e3 ~! _  sig_h:in std_logic_vector(2 downto 0);. c+ T+ W; G2 l+ ?& X" O0 Y$ T) R
  din_h1ut std_logic_vector(3 downto 0);
. J' t) [1 R, R' A, `0 {- b  din_h0ut std_logic_vector(3 downto 0);5 t9 Q0 a, E, ^2 m
  pmut std_logic;
: N- c% B6 B; P3 y# [( L" L  cp_h:out std_logic);8 }! A9 F3 E4 w$ |
  
: |; v7 Z; j0 B, C# kend hour;: j  ~+ ]& V/ i  ~9 y
architecture behav of hour is& ^( J6 I5 ~5 n% ?+ K, T; h" j
signal clk:std_logic;- z: a" |+ w; F. m  [' ]
begin
8 J+ `6 T( R  e$ c    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)4 G- @: _1 Q" r9 p3 ?9 Y0 |
     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);3 d0 v& U: e* k0 M
     variable co1:std_logic;  v0 D1 O& v; }- p0 W/ \. I
     variable co2: std_logic_vector(7 downto 0) ;
4 p$ |4 Q) c% Q8 s$ R0 I/ ]# m   begin
4 M9 B& ^' U3 \  h6 c    if sig_h="001"and tp_h='1' then clk<=clk_t;
( q4 t1 ^: n$ Q( [  J) E   else clk<=clk_h;; Q3 u% [9 |) A4 U8 m( m7 I' _0 h
   end if;; D* Y# p/ U  _
    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');
+ S* R4 y" }( f       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;; B  `0 r! I+ p0 K9 J0 I8 O/ W& [
      if cq1="1010" then cq2:=cq2+1;cq1:="0000";9 C* f  J5 g5 U& O% g
            end if;; y2 w6 S; t1 i4 D% _4 F+ k
            if  cq2="0010" and cq1="0100" then. E- \5 i; m+ L) @, D; p4 N2 e. o! G
    cq1:="0000";cq2:="0000";
# s! @0 l2 H! r/ J6 I    co1:='1';4 V7 M$ D* h2 i
   else co1:='0';
: T+ Z$ T) B' @* [      end if;( l0 p1 L# A2 _/ i/ ?6 P! Q
      if cq3="1010" then
& m7 r0 i: i5 `* V; y& L      cq4:=cq4+1;1 ]& q: t# W! B4 J
      cq3:="0000";
( s$ w' e, w7 e% ]9 d- f    end if;
5 t& }/ N' ?4 T8 t' Q! E: ]2 P   if cq4="0001" and cq3="0010" then 0 J  X6 C0 r. R3 D" r
         cq3:="0000";cq4:="0000";co2:=co2+1;* R4 x. a' P$ h
      end if;
3 l* [! e8 ?9 N" y    end if;
  ?3 c* p0 s' S. \  if hset='1' then    ' P# J; E) w$ t' l# l, G
          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;
$ y  `3 d: u4 E" R2 T! A0 f3 ?  D         else
4 G, R. D& b, h& F           if co2(0)='1' then + H& u* d, Z/ U* @9 l
             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';
2 \1 j; l: t4 m1 a             end if;
5 _# ~' \) \% z1 A6 Y- A             pm<='1';
7 Q; J+ `# p# g; d, n  V            else pm<='0';8 p; n7 S& n- ?
            end if;1 b6 E7 \' y+ H( x! B8 P
            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';
3 X# J/ S  m, F              else cp_h<='0';
. s3 e. p0 n; y7 R% i6 H/ j             end if;
/ \* l0 d8 p2 {           din_h1<=cq4;din_h0<=cq3;    J+ E0 Q: V7 x. a) ]8 v8 p
        end if;  --12/24转换
% ~. x. E( q& t  + w" H/ ~- V7 I; v" ^, A9 i# k% e
     end process;# q9 u& W" t! D7 A4 m
end behav;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:3 b4 Y7 w. s; N" p9 F% D1 L0 h9 p
Info: *******************************************************************- f% r. K5 q" S# V- o% i  X
Info: Running Quartus II Analysis & Synthesis
5 m6 v6 R) y8 \        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version2 m0 c. ^) I; d/ P1 w; O& u
        Info: Processing started: Sat Oct 31 17:04:02 2009% N+ W0 @" S& I, {
Info: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour
3 b3 n9 P: O" vInfo: Found 2 design units, including 1 entities, in source file hour.vhd
' r/ I5 F+ s2 x& A) c6 C! C5 Q/ h        Info: Found design unit 1: hour-behav- O+ V0 ?: `6 W; \% _+ w
        Info: Found entity 1: hour
4 _, d' G( t- C& y" U; |' ZInfo: Elaborating entity "hour" for the top level hierarchy4 ]. ~/ R; Q9 h" v! u5 c
Warning (10492): VHDL Process Statement warning at hour.vhd(29): signal "clk" is read inside the Process Statement but isn't in the Process Statement's sensitivity list
) ~" C/ U; U: ^% LWarning (10631): VHDL Process Statement warning at hour.vhd(20): inferring latch(es) for signal or variable "pm", which holds its previous value in one or more paths through the process
" ]! q0 c6 I) ]. T4 t! BInfo (10041): Inferred latch for "pm" at hour.vhd(20)' J  v5 c2 r* p( j: F; ~
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[0]" because its behavior does not match any supported register model6 v: ]1 N  R: V8 d* p3 v5 b
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[1]" because its behavior does not match any supported register model
0 B) t% h9 G, U% N" K# RError (10821): HDL error at hour.vhd(48): can't infer register for "cq4[2]" because its behavior does not match any supported register model* H3 p( e. C: F$ ]) i7 C9 y9 ~
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[3]" because its behavior does not match any supported register model
7 X( [8 R2 d$ S  I* A( j: ~$ e8 qError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[0]" because its behavior does not match any supported register model
; n/ o) ^& Z- W3 W+ H/ OError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[1]" because its behavior does not match any supported register model
% ~3 j6 }' C  p, E  q( w" vError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[2]" because its behavior does not match any supported register model. d% a, I: G9 z" m
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[3]" because its behavior does not match any supported register model
8 c3 s; R# d" y  B6 k' |Error: Can't elaborate top-level user hierarchy  T; m, h4 {  j) T* `$ b
Error: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings' e/ H1 t4 J6 e: P4 H. M) k/ m/ a" {
        Error: Peak virtual memory: 184 megabytes
' I% m; \. B0 H; N/ a        Error: Processing ended: Sat Oct 31 17:04:04 2009
5 l% ^$ V  U' M! C; _* q( I        Error: Elapsed time: 00:00:02& B8 _3 A9 c; ?
        Error: Total CPU time (on all processors): 00:00:01
" l1 x8 G# C5 L! sError: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

关于我们|手机版|EDA365 ( 粤ICP备18020198号 )

GMT+8, 2025-5-25 10:06 , Processed in 0.066262 second(s), 39 queries , Gzip On.

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

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

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