C7 Digital logic · Practice
Problem set 10: Verilog, design and logic in code
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 12 kinds solid
Check
A module declares wire [15:0] bus;.
(a)
How many wires is that?
(b)
How many bits does bus[15:0] select?
Check
Registers a = 7 and b = 5 run one clock of a <= b; b <= a + b; (nonblocking).
(a)
What is a afterward?
(b)
What is b afterward?
Check
The same registers (a = 7, b = 5) instead run a = b; b = a + b; (blocking) once.
(a)
What is a afterward?
(b)
What is b afterward?
Check
A clocked block assigns reg [4-1:0] x, reg [1-1:0] y and reg [32-1:0] z, all with <=.
(a)
How many flip-flops does it create?
(b)
What is the largest value x can hold?
Check
A reg [4-1:0] c starts at 15 and runs c <= c + 1; each clock.
(a)
What does it hold after 50 clocks?
(b)
How many times has it wrapped through 0?
Check
A 4-bit ripple-carry adder adds A = 9 and B = 5.
(a)
What is its 4-bit sum?
(b)
What is its carry out?
Check
The sandbox's vending machine sells a 15¢ item for nickels, one coin per clock, and vends on the third.
(a)
How many items have vended after 7 nickels?
(b)
How many cents is it holding toward the next?
Check
In Quine–McCluskey for 5 variables, a pattern has 1 dashes.
(a)
How many literals does its term have?
(b)
How many minterms does it cover?
Check
A 4-input truth table numbers its rows with the first input as the top bit.
(a)
What is input 0 (counting from 0 at the first input) in row 11?
(b)
Which row has every input inverted?
Check
A running-parity Mealy machine outputs the parity of all the 1s seen so far. A stream of 10 bits contains 6 ones.
(a)
What does it output after the last bit?
(b)
How many states does it need?
Check
always @(posedge clk) c <= c + 1; with an N = 12-bit c runs at 10 MHz.
(a)
What frequency comes out of its top bit?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
(b)
What's its largest value?
Check
always @(posedge clk) r <= {r[N-2:0], d}; with N = 8, followed by 1 more registers in a chain.
(a)
How many flip-flops in all?
(b)
After how many clocks does a bit of d reach the last register?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C7