Skip to content

Commit b7145a1

Browse files
committed
refactor(acquisition_send_usb.v): change parameter and reg sizes to improve code readability and reduce resource usage
The parameter sizes for IDLE, WRITING, SEND_ENABLE, and READING have been reduced from 4 bits to 1 bit each. This change improves code readability by aligning the sizes with their actual values. The reg sizes for state and next_state have been reduced from 5 bits to 4 bits each. This change reduces resource usage and aligns the sizes with the maximum number of states needed for the module.
1 parent fc61c16 commit b7145a1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ada.srcs/design/acquisition/acquisition_send_usb.v

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ module acquisition_send_usb (
4242
output reg send_busy
4343
);
4444
// parameter define
45-
localparam IDLE = 4'b00001;
46-
localparam WRITING = 4'b00010;
47-
localparam SEND_ENABLE = 4'b00100;
48-
localparam READING = 4'b01000;
45+
localparam IDLE = 4'b0001;
46+
localparam WRITING = 4'b0010;
47+
localparam SEND_ENABLE = 4'b0100;
48+
localparam READING = 4'b1000;
4949

5050
// reg define
51-
reg [ 4:0] state;
52-
reg [ 4:0] next_state;
51+
reg [ 3:0] state;
52+
reg [ 3:0] next_state;
5353

5454
reg [14:0] wr_addr;
5555
reg [14:0] rd_addr;

0 commit comments

Comments
 (0)