找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

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

求救—谁能帮忙改一改

[复制链接]

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

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

EDA365欢迎您!

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

x
library ieee;
& B/ b9 K; u2 I3 Q. ouse ieee.std_logic_1164.all;
( {* N; z. e8 b( U5 ~5 E+ u" ouse ieee.std_logic_arith.all;& p) e1 A! o4 B* K
use ieee.std_logic_unsigned.all;
5 _2 U/ Q  \8 D) k7 b% a( nentity hour is
7 S, N6 Y& c9 a- M port(clk_h,clk_t,tp_h,res_h:in std_logic;  c1 m0 I! E8 p2 T
  hset:in std_logic;" J' _! ~1 P& \7 E+ S$ n
  sig_h:in std_logic_vector(2 downto 0);, g, q1 N& `" i' W9 i2 n
  din_h1ut std_logic_vector(3 downto 0);; J3 q9 q6 u" o; O
  din_h0ut std_logic_vector(3 downto 0);
" @8 f3 h+ Z# N! S: y  pmut std_logic;
* f* q6 ~/ J* G; n  cp_h:out std_logic);
/ a/ ^2 ]. `0 g( M% _% s  
9 `* a7 Z3 e2 n0 z$ v# kend hour;
2 ~& D4 R2 h6 M  M' r" C7 x. ~architecture behav of hour is1 w) k- B' [5 @0 `+ A" H8 z
signal clk:std_logic;
9 X/ I  h1 b$ d; lbegin
- K7 w& k. Z& ~  J  t4 n. w7 F/ U    process(clk_h,clk_t,tp_h,sig_h,res_h,hset)2 I* J1 }5 t- X) M0 E5 |! e5 Y$ a, L7 S
     variable cq1,cq2,cq3,cq4:std_logic_vector(3 downto 0);
- s, F7 ]1 j' D9 C     variable co1:std_logic;
7 u. k$ J8 }- ^9 ?     variable co2: std_logic_vector(7 downto 0) ;
: ^" t  H/ U8 [( [4 h   begin / a$ I& Z; m$ b
    if sig_h="001"and tp_h='1' then clk<=clk_t;! ^6 f$ M1 {: N5 O
   else clk<=clk_h;) f# g7 w4 v9 B: x3 z0 K% H) a
   end if;8 N8 F" Q' s2 y
    if res_h='1' then cq1:="0000";cq2:="0000";cq3:="0000";cq4:="0000";co2:= (OTHERS =>'0');5 j6 F" k% a' R& R
       elsif  clk'event and clk='0' then cq1:=cq1+1; cq3:=cq3+1;4 `3 x' H# z0 \0 S7 g" X
      if cq1="1010" then cq2:=cq2+1;cq1:="0000";' q& p) K% x8 ~
            end if;! j) z1 F( Y- `  u8 \
            if  cq2="0010" and cq1="0100" then
6 ^4 A8 P( s* r& I    cq1:="0000";cq2:="0000";
% L7 W' a' R6 X6 D: z- a    co1:='1';
8 ]0 k% r" X) O1 G, Q7 ?   else co1:='0';- A. z  _) Y8 N0 B5 L
      end if;3 q/ N3 K$ \' p( x# J  b8 {
      if cq3="1010" then 2 i5 |! E* z8 M
      cq4:=cq4+1;
; x. I# O& S3 J# o6 f. i' @3 {      cq3:="0000";
) m; |+ s; b6 p/ a5 G$ `    end if;
6 w, ^4 R' z% r) e& T4 k+ Z$ I) a6 Y2 |   if cq4="0001" and cq3="0010" then ! ]% z9 W( Z# q$ C4 I' L) I; j
         cq3:="0000";cq4:="0000";co2:=co2+1;
" j3 a& g8 y2 m  n      end if;
0 M* x. _: f5 g! ?8 ?    end if;
5 Y  s1 h& y+ L4 u  if hset='1' then    0 J8 {/ X4 {- H% M1 V& ?5 F
          din_h1<=cq2;din_h0<=cq1;cp_h<=co1;
6 E4 g, X! c8 G/ L3 z7 t2 d( c  I" d         else
, O; s* P! J7 n4 i& \           if co2(0)='1' then 0 o' S, J' O! u
             if cq3="0000" and cq4="0000" then cq3:="0010";cq4:="0001";pm<='0';
' T- e3 [! E. C  K- ?# _( ]             end if;
0 S( U$ \6 _- c# }- X3 B             pm<='1';
# m6 i8 X% X8 X$ [3 A            else pm<='0';
- A5 J0 N9 {$ z8 \& x# Q            end if;
: W1 R& b# C" S0 U8 ~; T            if co2(0)='0' and cq3="0000" and cq4="0000" then cp_h<='1';
/ b# ~: F: U: R! v$ s              else cp_h<='0';
: Z0 M# L1 _. _, F8 `             end if;2 l$ _8 z+ \3 \# a, D+ L+ v; O
           din_h1<=cq4;din_h0<=cq3;  
! _0 [5 W, W" ~  K- l        end if;  --12/24转换! f, W  B3 _  d. y. M, r$ o$ k& k
  
; K) K' k# E: _6 J     end process;8 W& `2 [; W. l* Q' G
end behav;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 支持!支持! 反对!反对!

1

主题

4

帖子

16

积分

二级会员(20)

Rank: 2Rank: 2

积分
16
2#
 楼主| 发表于 2009-10-31 17:10 | 只看该作者
报错:
2 K& s, C9 u1 w- tInfo: *******************************************************************
& {4 I9 q) S! p( h" {* v. Y1 ]Info: Running Quartus II Analysis & Synthesis) B# Z% c) ~; X; F' M3 }, ]
        Info: Version 9.0 Build 132 02/25/2009 SJ Full Version/ `; Y5 z( m7 c5 Z+ r/ \
        Info: Processing started: Sat Oct 31 17:04:02 20098 x/ h6 G7 f* H$ P# g
Info: Command: quartus_map --read_settings_files=on --write_settings_files=off hour -c hour
! o. w8 O; l5 ?Info: Found 2 design units, including 1 entities, in source file hour.vhd
2 M& L$ b/ o0 z: c  W6 s! C+ i% d        Info: Found design unit 1: hour-behav$ k: g& \, x( O) p; s0 l
        Info: Found entity 1: hour
4 ^' d4 s2 B  n8 A  \/ w: y7 dInfo: Elaborating entity "hour" for the top level hierarchy2 \- Z5 c% k; T2 ]3 ?! y4 _
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
6 ^* M! O+ c' g7 \$ G" ]Warning (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
, w5 g9 ?( F$ V% N4 ~Info (10041): Inferred latch for "pm" at hour.vhd(20)) S1 R- m$ `+ U$ {) n
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq4[0]" because its behavior does not match any supported register model
$ Z% o# H( G. b% X' j  n: [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% t% ?: c% [+ h( o
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  a5 o$ s9 H- X1 Y2 [
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
! ]% i6 F: d: y$ L  O7 [6 a8 z: Y; a1 hError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[0]" because its behavior does not match any supported register model( V1 J! n5 J6 G0 e+ [
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[1]" because its behavior does not match any supported register model9 ?, l: {$ p  i0 n3 z
Error (10821): HDL error at hour.vhd(48): can't infer register for "cq3[2]" because its behavior does not match any supported register model
9 i% T0 _# G  wError (10821): HDL error at hour.vhd(48): can't infer register for "cq3[3]" because its behavior does not match any supported register model+ D+ \# e2 V6 a
Error: Can't elaborate top-level user hierarchy
5 X/ g8 u; @4 dError: Quartus II Analysis & Synthesis was unsuccessful. 9 errors, 2 warnings
. Z0 {' ?: H4 N3 K        Error: Peak virtual memory: 184 megabytes% I% N0 j  l( M7 E3 |  w, f: S# H
        Error: Processing ended: Sat Oct 31 17:04:04 2009
" W& A* R9 o4 R# g        Error: Elapsed time: 00:00:026 O, K4 n4 J  `$ F/ }
        Error: Total CPU time (on all processors): 00:00:016 O" {5 @/ M1 Y0 Z4 n
Error: Quartus II Full Compilation was unsuccessful. 11 errors, 2 warnings
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

巢课

技术风云榜

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

GMT+8, 2025-6-3 19:31 , Processed in 0.059364 second(s), 38 queries , Gzip On.

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

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

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