|
各位先進大大好," \& |+ Z& [# t. ?% N
! m3 a5 F/ [) f跟各位請教個問題..5 k' `* T* m+ f# Z' y4 h9 g" Q
! D+ ?. ^, E( @" }) d原本1是a,b,x是我自定的輸入值,這樣可以正確的輸出值,
$ i* p ]+ w5 ?( ~4 L6 j! G$ g2改成隨機輸入a,b,x時郤沒有輸出值,問題在哪? = =: N3 y. X0 ? O
BestRegards 3 w# o8 \& a4 y! t* x. g
^^" y' N5 \: U9 w$ T( T/ U" \2 m6 P
---
1 R Y1 B7 N' I1 j ?1.) ]1 L. \' {# y [
module modtest(/ _2 v+ B1 y" k) U: F
input [4:0] x,
2 g1 j" O) t# r& Ninput [4:0] a,b,1 M9 z, u! A# p7 a
input clock,
4 t3 l' Z. J8 M0 Coutput [12:0] m1 a* I2 j: A% T& [. b6 H, x
);
9 ~3 f8 p# w9 L/ Vreg [12:0] x_1; h3 F9 S x. J
always@(posedge clock)( f( w( O7 U$ e/ s K: Y+ x. ]
begin
9 p2 u8 e. r4 ^$ u4 }+ pa=8;
% A" h7 z% [: n0 L9 e$ W U$ ?% V9 Qb=4;+ o: u, L# I; j: ~* o& [; P7 Y2 K
x=7;; z9 P; K$ `2 |% ^# }$ {+ M9 C
x_1=512-((1024*((x-a)))/b);& L0 d5 x" ^4 r$ V
end# l9 T, F ~% w
assign m=x_1;" [) `' c+ a$ A) {. ~# @
endmodule/ A# \9 R2 {4 y! W* d
9 P2 c" t/ a3 J U8 S3 p; r/ |" e--------% h: U$ D7 b% }+ E/ |4 c8 \
2.
; P4 L4 `3 ~! @; lmodule modtest(2 ?- _: |2 @% i+ D6 u2 G3 X
input [4:0] x,
4 B& f7 e8 @5 a0 ~1 Minput [4:0] a,b,- |+ O# H; }$ L, M3 L% ^" u3 y
input clock,- T9 W3 m! U8 c, A; s3 b C; o; [
output [12:0] m0 o; n. N5 ?, y3 A k" j; Z. o) _% }% R
);
4 E1 u' A$ X; H, creg [12:0] x_1;2 f; d3 ]$ B# B1 Y' ~$ r- L
always@(posedge clock)+ V% x$ E! g5 F) R0 P3 ~- ~
begin J5 b/ D% j1 V1 f4 U& e
x_1=512-((1024*((x-a)))/b);& ~4 t/ w, S) u5 {$ Y
end
3 ?" Q* Y) ^+ ^- ~3 aassign m=x_1;9 `7 h, S* |. N- p4 p# J! F, a
endmodule |
|