Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module modpm(
- input logic [5:0]in_num,
- input logic mode12,
- output logic [5:0] out_num,
- output logic [1:0] diatarde
- );
- localparam hrs24 = 2'b00;
- localparam AM = 2'b01;
- localparam PM = 2'b10;
- localparam doce = 6'd12;
- always_comb
- if(mode12 == 1)
- if (in_num >= doce) begin
- out_num= in_num - doce;
- diatarde = PM;
- end
- else
- begin
- out_num = in_num ;
- diatarde = AM;
- end
- else
- begin
- out_num = in_num ;
- diatarde = hrs24;
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement