is it possible for bcd to ascii module?

Guest #5485876
1. Ensure that BCD is in range of borders 0...99
2. Per Byte: Byte to Hi/Lo nibble ( shift by 4 and with 0x0F for hi, and 
with 0x0F for lo nibble)
3. Per Nibble: ASCII = nibblevalue + 0x30

See also wiki

ASCII      char 0x30 = '0'
Guest #5486966
Something like
1
module bcd2ascii #(
2
    parameter N_DIGITS = ...
3
) (
4
    input wire [4*N_DIGITS-1:0] bcd_in,
5
    output reg [8*N_DIGITS-1:0] ascii_out
6
);
7

8
integer i;
9

10
always @ (*) begin
11
    for (i = 0; i < N_DIGITS; i = i + 1) begin
12
        ascii_out[i * 8 +: 8] = 8'h30 + bcd_in[4 * i +: 4];
13
    end
14
end
15

16
endmodule

Could be what you need. It would require some effort on your part to 
adapt this to your needs and make sure that it works. You didn't mention 
language, so I assumed Verilog.
Guest #6459531
what does this statement mean =(" parameter N_DIGITS = ...")
Can you please explain, it's a bit of an emergency
Moderator (Company: Titel) #6465413
Harry wrote:
> can anyone help me to wrie a multichannnel UART verilog code?
Start a new thread for an new question!

Provide something with a particular problem. No one will do your entire 
homework.

Define more precisely what you mean with "multichannel UART".

Reply

A question of your own? This thread is over 8 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.