|
各位先進大大好,
, { ~# k! q( }4 u3 X7 I+ ]3 F0 \8 y1 U6 A+ H4 B
跟各位請教個問題..
, W3 j+ A! j5 P+ v! O: g
3 ]% u5 u$ @ y8 U4 }原本1是a,b,x是我自定的輸入值,這樣可以正確的輸出值, z4 g2 R4 n9 @; S" M: o0 m7 l
2改成隨機輸入a,b,x時郤沒有輸出值,問題在哪? = =' b4 `6 v( ?- I* w u5 _
BestRegards 0 A* }3 B( y; K0 @* h2 D/ j( D
^^& I$ I) E; w* I1 z: E7 r
---% e3 l2 u* K1 c
1.
- s' D* ?. ~# R; ^2 Smodule modtest(
. u2 t @! k$ X* m) D. K3 cinput [4:0] x,# n8 \6 F. u, r) D, t/ L
input [4:0] a,b,5 ~! n1 Q. C; H, J3 @
input clock,
p3 b( J: e, f3 a- woutput [12:0] m
, d ?% b8 K$ Z' r);
1 E6 Y, k N3 X/ mreg [12:0] x_1;
; E x! [) o/ o$ A+ P1 Salways@(posedge clock)6 {7 X# b4 K7 B0 J
begin
' i7 L5 m( X9 I( X$ `# R$ p+ G, va=8;
+ C) d; t. b" N2 v1 I. tb=4;1 Q& f- g1 _, c& S" y
x=7;4 W& C8 E' r7 w+ `: ^
x_1=512-((1024*((x-a)))/b);6 q- u& [+ Z, u% |7 B0 e
end) [* M, u. u' {# k; ~
assign m=x_1;- C; V/ T2 \5 @& u* |( @2 z
endmodule6 a9 L# Z% f' L* L5 M: }
: a5 U2 [2 Z# B) L
--------) u6 ]+ o( p/ M7 M
2.
6 G/ h9 n3 ^* Gmodule modtest(* J; s0 ]2 u. {' o- ^2 F: ]) C0 @2 z
input [4:0] x,
0 F6 S0 H" k* K2 [input [4:0] a,b,9 b& b1 S R% H* |8 K
input clock,$ u/ Z, e* b# H
output [12:0] m
* z4 m1 Z6 O% v& Y) g);; w" n& M6 V1 X1 X3 `
reg [12:0] x_1;5 |1 u* ]9 `2 G4 N1 A
always@(posedge clock)& g: l' m# r% l# U
begin
2 Z; A4 b6 H8 L& r# g( H5 t3 A1 { x_1=512-((1024*((x-a)))/b);; v& V/ F9 z Q3 y: h9 Q7 r
end, h2 H' v. N. u
assign m=x_1;
4 V* ^3 z2 s" Tendmodule |
|