So, I recently decided to learn a HDL properly and was following one of Cornell's online courses (here, for those interested) and right in the first lecture the professor introduces something I don't yet understand - inferred latches.
Around this time, the professor describes how an incomplete 'case' statement might lead to an inferred latch due to the behavior of the output wire to retain its previous state if no driver for it is present. I understand how that might lead it to synthesize a latch to 'hold' its last value; what I don't really get is why such behavior is expected in the first place.
HDLs model real hardware and in case of the 'case' statement it should implement a multiplexer. If one of the mux inputs is left unconnected (as it would be if you leave out one of the switch cases) shouldn't it be left 'floating' (as in 'real' hardware)? The specified behavior of retaining the last value makes sense if you want to make it easier for a simulator but don't HDLs have a 'high Z' value too?
I'm new to all this so any help in understanding this better would be appreciated.
(And it has been some time since I've been here. It's definitely good to back!)
Around this time, the professor describes how an incomplete 'case' statement might lead to an inferred latch due to the behavior of the output wire to retain its previous state if no driver for it is present. I understand how that might lead it to synthesize a latch to 'hold' its last value; what I don't really get is why such behavior is expected in the first place.
HDLs model real hardware and in case of the 'case' statement it should implement a multiplexer. If one of the mux inputs is left unconnected (as it would be if you leave out one of the switch cases) shouldn't it be left 'floating' (as in 'real' hardware)? The specified behavior of retaining the last value makes sense if you want to make it easier for a simulator but don't HDLs have a 'high Z' value too?
I'm new to all this so any help in understanding this better would be appreciated.
(And it has been some time since I've been here. It's definitely good to back!)