优化设计

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

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

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

Loading…
Cancel
Save