优化设计

main
阳光少年 8 months ago
parent 959f627046
commit c4402237ad

@ -7,11 +7,6 @@ module dt(
output reg S1, S2, S3, S4
);
parameter _SELECT_1 = 4'b1110;
parameter _SELECT_2 = 4'b1101;
parameter _SELECT_3 = 4'b1011;
parameter _SELECT_4 = 4'b0111;
// ABCDEFG
parameter _SHOW_0 = 8'B1111110;
@ -55,13 +50,12 @@ always @(data) begin
default: ;
endcase
case (data[7:5])
3'b000: {S4, S3, S2, S1} = _SELECT_1;
3'b001: {S4, S3, S2, S1} = _SELECT_2;
3'b010: {S4, S3, S2, S1} = _SELECT_3;
3'b011: {S4, S3, S2, S1} = _SELECT_4;
default: {S4, S3, S2, S1} = 4'b1111;
endcase
if (data[7]) begin
{S4, S3, S2, S1} = ~(4'b0001 << data[6:5]);
end
else begin
{S4, S3, S2, S1} = 4'b1111;
end
end
endmodule

@ -67,7 +67,7 @@ wire [4:0]U;
assign U = W & V; // U, , 0
// && || ! 10 , | & ^ ~
// && || ! 10 (1, 1, 3'b010 && 3'b100 1), | & ^ ~
//

Loading…
Cancel
Save