본문내용
dge clk) begin
q[3]<=e;
q[2]<=q[3];
q[1]<=q[2];
q[0]<=q[1];
end
endmodule
================================================
================================================
module shift4(clk, e, q);
input clk, e;
output [3:0] q;
reg [3:0] q;
always @(posedge clk) begin
q[0]<=q[1];
q[1]<=q[2];
q[2]<=q[3];
q[3]<=e;
end
endmodule
================================================
(3) 앞의 shift register를 blocking 할당문을 사용하여 설계할 때에 어떠한 문제가 발생할 수 있는 지를 말하시오.
================================================
module shift4(clk, e, q);
input clk, e;
output [3:0] q;
reg [3:0] q;
always @(posedge clk) begin
q[0]=q[1];
q[1]=q[2];
q[2]=q[3];
q[3]=e;
end
endmodule
================================================
===============================================
module shift4(clk, e, q);
input clk, e;
output [3:0] q;
reg [3:0] q;
always @(posedge clk) begin
q[3]=e;
q[2]=q[3];
q[1]=q[2];
q[0]=q[1];
end
endmodule
===============================================
nonblocking의 경우 RHS의 값들을 계산한 후 LHS 변수를 갱신함으로써 문장들의 순서에 영향을 받지 않는다. 따라서 case1, case2의 경우가 모두 같다.
하지만 blocking의 경우는 다르다. 첫 번째 case의 경우는 종속 관계가 없어 nonblocking과 다를 것이 없지만 두 번째의 case에서는 서로 종속관계가 되어 clk이전의 값을 사용해야 되는데 clk이후의 값을 쓰는 꼴이 된다 따라서 shift되지 못한다.
q[3]<=e;
q[2]<=q[3];
q[1]<=q[2];
q[0]<=q[1];
end
endmodule
================================================
================================================
module shift4(clk, e, q);
input clk, e;
output [3:0] q;
reg [3:0] q;
always @(posedge clk) begin
q[0]<=q[1];
q[1]<=q[2];
q[2]<=q[3];
q[3]<=e;
end
endmodule
================================================
(3) 앞의 shift register를 blocking 할당문을 사용하여 설계할 때에 어떠한 문제가 발생할 수 있는 지를 말하시오.
================================================
module shift4(clk, e, q);
input clk, e;
output [3:0] q;
reg [3:0] q;
always @(posedge clk) begin
q[0]=q[1];
q[1]=q[2];
q[2]=q[3];
q[3]=e;
end
endmodule
================================================
===============================================
module shift4(clk, e, q);
input clk, e;
output [3:0] q;
reg [3:0] q;
always @(posedge clk) begin
q[3]=e;
q[2]=q[3];
q[1]=q[2];
q[0]=q[1];
end
endmodule
===============================================
nonblocking의 경우 RHS의 값들을 계산한 후 LHS 변수를 갱신함으로써 문장들의 순서에 영향을 받지 않는다. 따라서 case1, case2의 경우가 모두 같다.
하지만 blocking의 경우는 다르다. 첫 번째 case의 경우는 종속 관계가 없어 nonblocking과 다를 것이 없지만 두 번째의 case에서는 서로 종속관계가 되어 clk이전의 값을 사용해야 되는데 clk이후의 값을 쓰는 꼴이 된다 따라서 shift되지 못한다.
키워드
추천자료
State Transition Diagram of Signal Lamp, 베릴로그, 실험소스
ALU, Shifter, 베릴로그 소스, 예비, 결과레포트
Single Cycle CPU 제작,베릴로그, 소스, 레포트
RAM에서의loadstore 기능구현, 베릴로그, 쿼터스, 결과소스
ALU( Ripple Carry Adder 이용 ),Wallace( 곱셈기 ),베릴로그,쿼터스, 소스
Control Logic Unit, 베릴로그, 결과파일, 소스
Decoder, Segment, MUX, 예비, 결과레포트 및 베릴로그 소스
Up Down Counter, Ring Counter, 베릴로그, 쿼터스
RCA, CLA, Subtractor(Compararot이용), 베릴로그, 소스파일있음.
소개글