|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 larlyii 于 2011-5-27 18:32 编辑
小弟我最近分别用连续赋值和过程块写了2个很简单的数据选择器,选择端是2bit的,综合出来的RTL Viewer不一样,但我看时序分析完全一样。这2种写法综合出来的电路是不是一样的呀?只是RTL Viewer看到的不一样?
- module temp_2(
- input [1:0]sel,
- input a, b, c,
- output out
- );
- assign out = (sel == 2'b00) ? a :
- (sel == 2'b01) ? b :
- (sel == 2'b10) ? c : 0;
- endmodule
复制代码
RTL Viewer图如下
另一种是用过程块写的:
- module temp(
- input [1:0]sel,
- input a, b, c,
- output reg out
- );
- always @(*) begin
- case (sel)
- 2'b00 : out <= a;
- 2'b01 : out <= b;
- 2'b10 : out <= c;
- default : out <= 0;
- endcase
- end
- endmodule
复制代码
RTL Viewer图如下:
|
|