Fix faulty example

This commit is contained in:
Owen Dorweiler 2025-12-09 15:50:50 -05:00
commit 14d13dce3e

View file

@ -133,7 +133,7 @@ If we aren't backtracking, we can store the current move to the stack as a valid
If we are backtracking, the FSM sets `stack_en` to `1` and `stack_op` to `1`, corresponding to a pop operation. The previous move is popped from the stack and the current move is **not** pushed since they "cancel out".
> *Example: We push our left (`11`) move to the stack since we aren't backtracking.*
> *Example: We push our down (`10`) move to the stack since we aren't backtracking.*
### Updating the Next Address & Internal Registers
@ -147,11 +147,11 @@ The current move is translated into an ALU operation and input like this:
The `x_y` bus is added to or subtracted from the current address to form the next address, stored in the `next_addr_reg` register and split into its x and y chip outputs with the `addr_split` module. This address is requested from memory.
> *Example: Let's say our previous address was [x,y] = [13,5] (`11010101`), and our current move is left (`11`). We subtract 1 from the x coordinate: `11010101` - `00010000` = `11000101`, which is [12, 5]. The outputs x = 12 and y = 5 are requested from external memory.*
> *Example: Let's say our previous address was [x,y] = [13,5] (`11010101`), and our current move is down (`10`). We subtract 1 from the y coordinate: `11010101` - `00000001` = `11010100`, which is [13, 4]. The outputs x = 13 and y = 4 are requested from external memory.*
The final part of the main FSM loop involves updating the internal registers. The current move is written to the abs_dir_reg, since it is not the absolute direction we are travelling through the maze. The current address is updated to the next address. The FSM then returns to S1 where it waits for the next input.
> *Example: The current move, left (`11`), is written to the `abs_dir_reg` register. The address stored in the `next_addr_reg` register, `11000101`, is stored in the `cur_addr_reg` register.*
> *Example: The current move, down (`10`), is written to the `abs_dir_reg` register. The address stored in the `next_addr_reg` register, `11010100`, is stored in the `cur_addr_reg` register.*
### Outputting the Solution