Akisha11 / Dise-o-digital-en-HDL-

0 stars 0 forks source link

Subsistema de conversión de binario de 13 bits a BCD #3

Open Akisha11 opened 1 year ago

Akisha11 commented 1 year ago

crear e implementar en el proyecto el subsistema que tome los números binarios de 14 bits procesados por el sistema de sincronización y realizar la respectiva conversión a BCD.

Akisha11 commented 1 year ago
module bin_to_bcd(
    input [12:0] bin_num,
    output [15:0] bcd_num
);

reg [15:0] temp;

always @(*) begin
    case (bin_num)
        13'd0: temp = 16'h0000;
        13'd1: temp = 16'h0001;
        13'd2: temp = 16'h0002;
        13'd3: temp = 16'h0003;
        13'd4: temp = 16'h0004;
        13'd5: temp = 16'h0005;
        13'd6: temp = 16'h0006;
        13'd7: temp = 16'h0007;
        13'd8: temp = 16'h0008;
        13'd9: temp = 16'h0009;
        13'd10: temp = 16'h000a;
        13'd11: temp = 16'h000b;
        13'd12: temp = 16'h000c;
        13'd13: temp = 16'h000d;
        13'd14: temp = 16'h000e;
        13'd15: temp = 16'h000f;
        13'd16: temp = 16'h0010;
        13'd17: temp = 16'h0011;
        13'd18: temp = 16'h0012;
        13'd19: temp = 16'h0013;
        13'd20: temp = 16'h0014;
        13'd21: temp = 16'h0015;
        13'd22: temp = 16'h0016;
        13'd23: temp = 16'h0017;
        13'd24: temp = 16'h0018;
        13'd25: temp = 16'h0019;
        13'd26: temp = 16'h001a;
        13'd27: temp = 16'h001b;
        13'd28: temp = 16'h001c;
        13'd29: temp = 16'h001d;
        13'd30: temp = 16'h001e;
        13'd31: temp = 16'h001f;
        13'd32: temp = 16'h0010;
        13'd33: temp = 16'h0011;
        13'd34: temp = 16'h0012;
        13'd35: temp = 16'h0013;
        13'd36: temp = 16'h0014;
        13'd37: temp = 16'h0015;
        13'd38: temp = 16'h0016;
        13'd39: temp = 16'h0017;
        13'd40: temp = 16'h0018;
        13'd41: temp = 16'h0019;
        13'd42: temp = 16'h001a;
        13'd43: temp = 16'h001b;
        13'd44: temp = 16'h001c;
        13'd45: temp = 16'h001d;
        13'd46: temp = 16'h001e;
        13'd47: temp = 16'h001f;
        13'd48: temp = 16'h0020