Skip to content

Instantly share code, notes, and snippets.

@mkvenkit
Created December 20, 2020 13:04
Show Gist options
  • Select an option

  • Save mkvenkit/dd50ed6123cd57cd805181e3e8cd1fa7 to your computer and use it in GitHub Desktop.

Select an option

Save mkvenkit/dd50ed6123cd57cd805181e3e8cd1fa7 to your computer and use it in GitHub Desktop.
Here are the highlights from the frame buffer display logic in dot88.v
always @ (posedge clk)
begin
// initialise
if (!resetn)
begin
pcounter <= 0;
d88_counter <= 0;
xp <= 0;
yp <= 0;
end
d88_counter <= d88_counter + 1;
if (!d88_counter)
begin
pcounter <= pcounter + 1;
// calculate position
xp <= pcounter/8;
yp <= pcounter - 8*(pcounter/8);
// update row/col
c <= fb[pcounter-1] ? (8'd1 << (7 - xp)) : 8'd0;
r <= ~(8'd1 << (7 - yp));
end
end
assign {row, col} = {r, c};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment