We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfc51fb commit 0cb1a8eCopy full SHA for 0cb1a8e
1 file changed
src/main/scala/RISCV/Memory.scala
@@ -33,15 +33,15 @@ class Memory() extends Module {
33
io.read_value_2 := 0.U
34
35
val isVGA = io.address_1 >= 0b1000000000000.U;
36
- io.address_vga := Mux(isVGA, io.address_1 - 0b1000000000000.U, 0.U);
+ io.address_vga := Mux(isVGA, io.address_1 / 0b1000000000000.U - 1.U, 0.U);
37
io.write_vga := isVGA && io.write_1
38
io.write_value_vga := io.write_value_1
39
40
when(io.write_1) {
41
when(isVGA) {
42
printf(
43
"Writing to VGA! Address: %b Data: %b\n",
44
- io.address_1 - 0b1000000000000.U,
+ io.address_1 / 0b1000000000000.U - 1.U,
45
io.write_value_1
46
);
47
}.otherwise {
0 commit comments