找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

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

求救—谁能帮忙改一改

[复制链接]

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

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

EDA365欢迎您!

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

x
library ieee;) D! R# }4 q6 M% \! p
use ieee.std_logic_1164.all;/ u& ]. G0 b* K; W! C  y2 _
use ieee.std_logic_arith.all;
( |) m( N. ]( D% F7 C, o  Fuse ieee.std_logic_unsigned.all;
) E8 d0 t. s( N2 Dentity hour is4 b: s0 F" T, R7 C5 r5 I
port(clk_h,clk_t,tp_h,res_h:in std_logic;2 F  X7 s& s- ^
  hset:in std_logic;
& ?( P& G! A; `7 n6 e" b  sig_h:in std_logic_vector(2 downto 0);! x! V2 `/ j/ X, O( r+ [4 u
  din_h1ut std_logic_vector(3 downto 0);0 Y0 f* f% X; s5 y6 T! _
  din_h0ut std_logic_vector(3 downto 0);) R% o; b* U5 i# Z& D
  pmut std_logic;9 P4 s1 X! W( D2 F$ u$ K& m+ ?
  cp_h:out std_logic);7 P5 Q% O# ~3 L  B3 Z
  
: t' X8 }# F6 K" a% Bend hour;
$ {9 x$ D  Y! ~9 [9 [1 z  B" rarchitecture behav of hour is2 y$ n% A. S0 w( l! I
signal clk:std_logic;' x. v$ g7 h5 T( K, I3 y
begin# _$ l4 t, g7 D( t" ^
    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)
7 q& |/ O2 C9 V3 G5 w9 `     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);* i7 p3 Y$ z) a9 ?( n
     variable co1:std_logic;
$ a6 E) g1 c5 A, q8 E% Q     variable co2: std_logic_vector(7 downto 0) ;
0 W, R4 ]# J  o) I   begin 8 s" A! y) S5 k
    if sig_h="001"and tp_h='1' then clk<=clk_t;
8 [% J* |2 t. K+ s. D   else clk<=clk_h;5 Z% G% W9 B( A( L4 V( k
   end if;
* t. j/ W) V/ x" T: H, V4 B    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');
+ C8 }6 H5 B3 ]2 y8 x       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;
+ x5 z4 L3 R$ j, h& c; k4 \      if cq1="1010" then cq2:=cq2+1;cq1:="0000";/ R2 N7 S- v4 F1 G" a. C- `
            end if;. u2 T! d7 E' o3 Z! R% y" x1 e
            if  cq2="0010" and cq1="0100" then7 O6 ~6 ~: s6 ~
    cq1:="0000";cq2:="0000";# d; S( [4 }$ @( h! g
    co1:='1';, o* {' v; i- @1 `9 T
   else co1:='0';
! H. s/ p* C# Z      end if;
1 _* m/ P1 \; q1 f% D8 ?      if cq3="1010" then " |- p! @0 u6 F6 k* Q
      cq4:=cq4+1;, \, H8 x1 H+ `4 F
      cq3:="0000";
4 o& [) ?6 n1 Z7 K) z5 ]    end if;- p3 e6 A0 t. A/ n
   if cq4="0001" and cq3="0010" then
0 u! g  i# z3 g5 i. D         cq3:="0000";cq4:="0000";co2:=co2+1;
' R  a/ l+ Q7 t      end if;
+ L; a3 n" i9 a) R    end if;. j# Z* v4 f  w" i9 v
  if hset='1' then    : \4 r! i  M9 r6 Z
          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;. S' z! u% P* ^$ }, Y% `
         else  b6 S0 b* u0 z+ f8 k
           if co2(0)='1' then
% X8 C! D, s" ~, v3 _) e! J4 A             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';
  y$ l0 Y9 W; y' U             end if;
% d1 `! p3 F+ c             pm<='1';% n% E9 _' Y2 `' _  {& H; d$ j
            else pm<='0';3 X2 g' K8 x# ?; o
            end if;
/ z- G8 k& _  y1 l" Z0 n$ Z3 J) C            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';
) w4 ?" F6 `  ]0 N7 Q. o$ L              else cp_h<='0';
8 X/ Z3 a- V- K. t             end if;
. q+ M- G# _4 D  v2 Y& E/ z6 A  p           din_h1<=cq4;din_h0<=cq3;  & S, c1 `- q: h# o4 D" \
        end if;  --12/24转换
$ T/ w( e9 R* m; `2 t    Z- t) L9 k) Z( I( O" L% o
     end process;, {7 h; Z+ T( a( h( U
end behav;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:. r" C1 I5 o4 L6 l$ s- S$ a+ ?
Info: *******************************************************************
9 \3 ]$ g* x1 F1 {4 h% [& f- n5 a9 |- l8 tInfo: Running Quartus II Analysis & Synthesis7 x! \% m- P( a
        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version
0 k# X# Z& g8 I. j; {8 U        Info: Processing started: Sat Oct 31 17:04:02 2009
# P5 n) [  {- R3 {9 uInfo: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour# k: X" y3 W5 P7 y. }. R, n
Info: Found 2 design units, including 1 entities, in source file hour.vhd5 K3 `" _( u+ z5 z$ {& O$ \
        Info: Found design unit 1: hour-behav8 a6 f/ h$ X. ?9 h" z4 i
        Info: Found entity 1: hour* R" y2 D' s( I+ @
Info: Elaborating entity "hour" for the top level hierarchy
2 f0 A- N1 J) J* j! A9 _! XWarning (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
9 `( x- u7 G/ p: n( M( B6 rWarning (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
# X3 w; z$ C: \" c4 zInfo (10041): Inferred latch for "pm" at hour.vhd(20)
$ e/ L* v1 D4 k0 `( l4 p% kError (10821): HDL error at hour.vhd(48): can't infer register for "cq4[0]" because its behavior does not match any supported register model' f, @( }7 K) \/ G. i! l2 _
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[1]" because its behavior does not match any supported register model7 G( W) d4 v* q, a2 g  w  w3 n4 w
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[2]" because its behavior does not match any supported register model) ^4 k! G3 e) U5 c$ M
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. Z/ B6 q: s1 V$ m2 ?4 F* S9 `
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[0]" because its behavior does not match any supported register model* A" i: v$ e4 H! H1 x
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[1]" because its behavior does not match any supported register model
* F" w; f! }0 s5 w  bError (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; i- I4 Q) q% X6 k; ]8 J8 nError (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 }- N0 Z( i% ]Error: Can't elaborate top-level user hierarchy
6 _, y/ F- D: ]! }+ dError: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings$ E. S" N$ g1 I: e# ~* t
        Error: Peak virtual memory: 184 megabytes
% n/ C% t0 [6 B+ p2 n2 O        Error: Processing ended: Sat Oct 31 17:04:04 2009: v0 P: T% I+ t7 Q8 V0 s
        Error: Elapsed time: 00:00:021 r  g) d# w6 ?. d" P8 q3 j
        Error: Total CPU time (on all processors): 00:00:01/ u8 X6 M( A: I1 m! t
Error: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

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

GMT+8, 2025-5-25 03:25 , Processed in 0.057047 second(s), 38 queries , Gzip On.

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

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

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