0

I'm trying to implement to gate as follows. But i'm not sure how does it synthesis to gate?

case 1

wire [3:0] A, B, C, D;  
always @(posedge CLK)
    begin
        C=B;
        B=A;
        A=D;
    end

case 2

wire [3:0] A, B, C, D;
always @(posedge CLK)
    begin
        A=D;
        C=B;
        B=A;
     end

Also.

case 3

wire [3:0] A, B, C, D;
always @(posedge CLK)
    begin
C<=B;
B<=A;
A<=D;
    end

case 4

wire [3:0] A, B, C, D;
always @(posedge CLK)
    begin
A<=D;
C<=B;
B<=A;
    end

Does anyone know how to synthesized to gate? Would you please illustrate this one?

BONGKA
  • 107
  • 1
  • 6

1 Answers1

2

None of those examples should compile, The variables should be of type reg:

D Needs to be declared regarding how it is generated.

reg [3:0] A, B, C;
always @(posedge CLK) begin
  A<=D;
  C<=B;
  B<=A;
end

Here A,C and B will synthesis to flip-flops. The order of A,C and B does not matter. They describe parallel hardware.

Morgan
  • 19,934
  • 8
  • 58
  • 84