Skip to content
This repository was archived by the owner on Jan 26, 2025. It is now read-only.

Fixed compile error #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions uart/Uart8Transmitter.v
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ module Uart8Transmitter (
reg [2:0] state = `RESET;
reg [7:0] data = 8'b0; // to store a copy of input data
reg [2:0] bitIdx = 3'b0; // for 8-bit data
reg [2:0] idx;

assign idx = bitIdx;

always @(posedge clk) begin
case (state)
Expand All @@ -45,7 +42,7 @@ module Uart8Transmitter (
state <= `DATA_BITS;
end
`DATA_BITS : begin // Wait 8 clock cycles for data bits to be sent
out <= data[idx];
out <= data[bitIdx];
if (&bitIdx) begin
bitIdx <= 3'b0;
state <= `STOP_BIT;
Expand All @@ -54,6 +51,7 @@ module Uart8Transmitter (
end
end
`STOP_BIT : begin // Send out Stop bit (high)
out <= 1'b1;
done <= 1'b1;
data <= 8'b0;
state <= `IDLE;
Expand Down