Questions tagged [bcd]

A binary-coded decimal (BCD) is a method of representing each decimal digit of a number with a fixed number of bits.

Though binary-coded decimal is less efficient memory-wise than 2's complement there are some advantages that result in BCD still being in use today, particularly in databases and applications where monetary and similarly sensitive data types are stored and manipulated.

194 questions
0
votes
2 answers

BCD to 7 segment Decoder

I just started VHDL coding, and right now have to code a BCD to 7 segment decoder. I am doing a Behavioral design(it's required) but right now I am having trouble on how to code the display. I know how to code this decoder with just one input and…
AOE
  • 109
  • 2
  • 7
  • 14
0
votes
4 answers

Microcontroller, How to display decimal on LCD?

I have a microcontroller and I am sampling the values of an LM335 temperature sensor. The LCD library that I have allows me to display the hexadecimal value sampled by the 10-bit ADC. 10bit ADC gives me values from 0x0000 to 0x03FF. What I am having…
user3147707
  • 3
  • 1
  • 3
0
votes
1 answer

Behavioral verilog bcd up down counter with enable and reset

I recently need to make a BCD up down counter with enable and reset. I have three always blocks but i dont know how to connect them together. I have my code from code segments given by my teacher. I wrote a structural verilog doing the same…
Ruka Tsoi
  • 45
  • 2
  • 3
  • 12
0
votes
0 answers

Pack 4 digit length number into a two byte char - packed bcd

I have to send a message where I am supposed to provide lengh of the message as 2 btye packed bcd header. Suppose if the length is 360 bytes, I should send [01][5E] Can someone guide me pls. Thanks.
Adarsh Nanu
  • 2,133
  • 1
  • 13
  • 18
0
votes
1 answer

does .net provides api to convert ascii to bcd?

Platfrom 3.5 .net.(c#) please refer me to code which converts ascii to bcd (c#).
Maddy.Shik
  • 6,609
  • 18
  • 69
  • 98
0
votes
1 answer

BCD to ASCII checksum

I have a very old device that I am connecting to through serial. When I am sending data it wants a checksum to be calculated with it. I add up all of the ascii valuesof the characters of the string and convert the sum to BCD. This results in…
JimT
  • 3
  • 2
0
votes
1 answer

How can I use SyncSort to convert data to unsigned packed format?

I have a requirement to convert numeric data (stored as character on input) to either packed signed or packed unsigned formats. I can convert to packed/signed using the "PD" format, but I'm having a difficult time getting unsigned packed data. …
0
votes
3 answers

String to BCD (embarcadero delphi)

Edit: I have (test file in ascii) the following record in ascii: "000000000.00" I need to output it ISO upon parsing it's counter part in BCD (the other test file in bcd/ebcdic). I believe it takes 6 char in BCD and 11 in ascii. So my need was…
Yain Tao
  • 71
  • 2
  • 6
0
votes
2 answers

String of Digits to ByteArrayOutputStream

in the following function, I have some trouble with an Array out of Bounds problem. It should convert a String of Digits into a BCD Format like this: "12345" -> 0x01 0x23 0x45 . The length of the String is not known. public void StringtoBCD(String…
Noob
  • 7
  • 4
0
votes
3 answers

Conversion from Integer to BCD

I want to convert the integer (whose maximum value can reach to 99999999) in to BCD and store in to array of 4 characters. Like for example: Input is : 12345 (Integer) Output should be = "00012345" in BCD which is stored in to array of 4…
0
votes
1 answer

Another BCD byte[] to int and back again

Im having trouble with some conversions, and can´t find whats wrong with the code, or with the idea of what it has to do. I have the following byte[] byte[] bytes = {0xFF, 0xFF, 0xFE}; which I convert into ulong this way: ulong next =…
miguel.hpsgaming
  • 461
  • 8
  • 17
0
votes
1 answer

Python BCD splitting nibbles and concatenation 2 ints

I feel like a complete tool for posting this, it is so basic and I cant believe I have wasted the last two days on this problem. I've tried all the solutions I can find on this (seriously, I will show you my internet history) but to no avail. Here…
morale_low
  • 3
  • 1
  • 5
-1
votes
1 answer

Convert short number to byte array java

my purpose to read from stream as byte per digit do some logic and write back to binary file Lets say the representation of data is 0F000200 17000000 07003B00 so we have method to represent it InputStream stream = new FileInputStream(args[0]); …
VitalyT
  • 1,671
  • 3
  • 21
  • 49
-1
votes
1 answer

How to convert BCD to decimal and vice versa?

I am trying to write code in JavaScript to convert binary-coded decimal into decimal and vice-versa. How can I achieve this?
mukara
  • 97
  • 2
  • 14
-1
votes
1 answer

How can I convert a hex value 81869400 into a decimal value 948681000

I have this as hex = 81869400 and I need this in decimal = 948681000 In the description I can see that the coding is a BCD8. I have invested a lot of time but cannot find the way.
Gamsner
  • 117
  • 1
  • 9
1 2 3
12
13