Skip to content

Commit baea106

Browse files
committed
Updated Gray functions
1 parent 0523320 commit baea106

File tree

8 files changed

+231
-363
lines changed

8 files changed

+231
-363
lines changed

ActionBurst.v

Lines changed: 0 additions & 84 deletions
This file was deleted.

ActionBurst2.v

Lines changed: 0 additions & 93 deletions
This file was deleted.

ActionBurst2_tb.v

Lines changed: 0 additions & 88 deletions
This file was deleted.

ActionBurst_tb.v

Lines changed: 0 additions & 89 deletions
This file was deleted.

bin2gray.sv

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//------------------------------------------------------------------------------
22
// bin2gray.sv
3+
// published as part of https://github.com/pConst/basic_verilog
34
// Konstantin Pavlov, pavlovconst@gmail.com
45
//------------------------------------------------------------------------------
56

@@ -26,9 +27,9 @@ module bin2gray #( parameter
2627
output logic[WIDTH-1:0] gray_out
2728
);
2829

29-
always_comb begin
30-
gray_out[WIDTH-1:0] = bin_in[WIDTH-1:0]^(bin_in[WIDTH-1:0]>>1);
31-
end
30+
always_comb begin
31+
gray_out[WIDTH-1:0] = bin_in[WIDTH-1:0] ^ ( bin_in[WIDTH-1:0] >> 1 );
32+
end
3233

3334
endmodule
3435

0 commit comments

Comments
 (0)