For example, below is RTL code to convert a 3bit binary counter to a Gray Code counter:
A 3-bit register binary counter is incremented by 1 each clock cycle. A signal named “gray_output” decodes the binary counter and then generates the new gray code output.
The problem with this approach is that for a Nbit
counter you need to explicitly decode each state. A better, more generic solution using an XOR gate is presented below:
This was just one question of over 50 questions that are in the Digital Logic RTL & Verilog Interview Questions Book. The book contains 41figures and drawings, and 28 pratical Verilog code examples.
Digital Logic RTL & Verilog Interview Questions |
1 Comments
ReplyDeleteI've been surfing on-line greater than 3 hours nowadays, yet I by no means discovered any fascinating article like yours. It's pretty price sufficient for me. In my opinion, if all webmasters and bloggers made good content material as you probably did, the web can be much more useful than ever before. gmail login email