hdlbits_Exams/review2015_shiftcount
【hdlbits_Exams/review2015_shiftcount】https://hdlbits.01xz.net/wiki/Exams/review2015_shiftcount
module top_module (
input clk,
input shift_ena,
input count_ena,
input data,
output [3:0] q);
always @(posedge clk)
begin
if (shift_ena)
q<=q*2+data;
else if (count_ena)
q<=q-1;
endendmodule
推荐阅读
- ACM|codeforces 732-D. Exams (二分)
- HDLBits Day12 count clock 做一个钟表
- HDLbits答案更新系列23(5|HDLbits答案更新系列23(5 Verification: Reading Simulation)
- HDLbits答案更新系列19(3.3|HDLbits答案更新系列19(3.3 Building Larger Circuits 3.3.1 Counter with period 1000等)
- HDLbits答案更新系列10(3.2|HDLbits答案更新系列10(3.2 Sequential Logic 3.2.4 More Circuits)
- HDLbits答案更新系列13(3.2.5|HDLbits答案更新系列13(3.2.5 Finite State Machines 3.2.5.10 Lemmings 1等)
- HDLbits答案更新系列9(3.2|HDLbits答案更新系列9(3.2 Sequential Logic 3.2.3 Shift Registers)
- HDLbits答案更新系列8(3.2|HDLbits答案更新系列8(3.2 Sequential Logic 3.2.2 Counters)
- HDLBits记录(二)
- HDLBits记录(三)