To better understand what it is that I'm asking about, please compare "Code A" to "Code B" below. Code B is more compact, but unfortunately does not produce what I would consider to be the "expected result" - which Code A does produce. I assume that the tools I'm using here do conform to the Verilog specification. I am trying to make sense of why this is the specified behavior. For example, does it make sense from some other perspective that I simply do not appreciate yet?
Note: In the waveforms, "speed" is the signal seen inside the MotorController module.
Code A
wire [9:0] motor0Speed;
wire [7:0] motor0SpeedDiv4;
assign motor0SpeedDiv4 = motor0Speed[9:2];
MotorController mc0(
.clock(CLK0),
.syncReset(syncReset),
//.speed(motor0Speed[9:2]),
.speed(motor0SpeedDiv4),
Code B
wire [9:0] motor0Speed;
MotorController mc0(
.clock(CLK0),
.syncReset(syncReset),
.speed(motor0Speed[9:2]), // <= This line of code is not working as I would expect!!!
If it's relevant, I'm simulating with:
Vivado v2023.2 (64-bit)
SW Build: 4029153 on Fri Oct 13 20:14:34 MDT 2023
IP Build: 4028589 on Sat Oct 14 00:45:43 MDT 2023
SharedData Build: 4025554 on Tue Oct 10 17:18:54 MDT 2023

