Advertisement
foreverfugazi

Untitled

Sep 18th, 2023
1,059
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module enc83(
  2.     input logic [7:0] d,
  3.     output logic [2:0] y
  4.     );
  5.     always_comb
  6.     case(d)
  7.     8'b00000001:y=3'b000;
  8.     8'b00000010:y=3'b001;
  9.     8'b00000100:y=3'b010;
  10.     8'b00001000:y=3'b011;
  11.     8'b00010000:y=3'b100;
  12.     8'b00100000:y=3'b101;
  13.     8'b01000000:y=3'b110;
  14.     8'b10000000:y=3'b111;
  15.     default:y=3'bxxx;
  16.     endcase
  17. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement