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
1 answer

How can I implement BCD in Fortran?

Not sure if the title of my question makes sense, so bear with me. I'd like to find a system for representing single digit numbers with as few bits as possible. There is a method called "Densely packed decimal"…
papiro
  • 2,158
  • 1
  • 20
  • 29
0
votes
1 answer

Create big numbers by BCD - C++

I want to create code that will help me get numbers bigger than MAXINT. I heard about that I can use Binary Code Decimal to do this, and then every two of decimal numbers(converted to BCD) of the bigger number keep in char. But how to do this? I…
bingo157
  • 113
  • 1
  • 2
  • 12
0
votes
1 answer

Subtraction assembly with "base 10" EMU8086

Hello I'm making a base 10 calculator in assembler that can take number with max length of 5 dig... so there is two numbers after the input was taken one of the five dig number is stored in ax and bl for example AX - 23 45 BX - 00 01 So the value…
BananaBuisness
  • 339
  • 2
  • 18
0
votes
1 answer

BCD adder of 4-BCD-digit numbers in VHDL

I am trying to implement a BCD adder of two 4-digit numbers i.e. 16 bits using the code of 1-digit BCD adder I found here. I used this code as the basic module and then I created a top entity that created and connected 4 instances of this basic…
mgus
  • 808
  • 4
  • 17
  • 39
0
votes
2 answers

Packed BCD 4 digit addition (8086 assembler)

Im having trouble writing this code. Could someone give me the solution (I understand BCD numbers, etc, I just can't write code that works)? It's supposed to add two packed BCD numbers (4 digits each; they are at addresses OP1 and OP2) and place…
Alek988Alek
  • 49
  • 14
0
votes
1 answer

4-Bit ALU to BCD display

I have a mega-assignment and the last part(for extra marks) is to display the output of a designed ALU using two 7-seg displays. These should display the result of the operations performed in the ALU. I am performing logical and arithmetic…
bzrk89
  • 55
  • 3
  • 9
0
votes
2 answers

String "8000000000000000" (16 bytes) to equivalent "BCD" (8 bytes) in Java

I made my own function to convernt one String to its equivalent bytes[] in BCD. Then i send this bytes to and DataOutputStram (with write method that requires an byte[] array). The problem is with the numeric String "8000000000000000". Look…
Nico
  • 374
  • 2
  • 4
  • 17
0
votes
1 answer

binary/BCD with 32/64bits questions

The question I have is determining the range of numbers (in base 10) that can be represented with a) 32bits and b) 64bits The first question I had was same concept, but asked to determine binary(base2) instead of BCD For 32bits I did 2^32 and 2^64…
SMLJ
  • 9
  • 4
0
votes
1 answer

BCD adder and Decimal Output

For Calculating Decimal Output of 125 * A - 100 * (A Mod 4) + 2 with having A ( one BCD digit) Which of the following is True? 1) we need at least two decimal adder. 2) we need at least two 4-bit binary adder. 3) we need at least one decimal…
user4249446
0
votes
1 answer

Converting 8 bit binary to BCD using integers

OK hello all , what i am trying to do in VHDL is take an 8 bit binary value and represent it as BCD but theres a catch as this calue must be a fraction of the maximum input which is 9. 1- Convert input to Integer e.g 1000 0000 -> 128 2- Divide…
0
votes
1 answer

Converting 8 bit binary to BCD value

I have spent countless hours on this and i just finally decided i really need some help..so here i am. Basically what i am doing is taking an 8 bit input from an ADC and then converting this value to BCD to dsiplay on a seven segment board. SO here…
0
votes
1 answer

Using arrays for BCD conversion in C

I'm working on a project where I need to convert some long variables into BCD. I already have some code that works but I feel that it can be improved... void main(void){ unsigned long input = 0; unsigned long convert = 0; float convert2…
Reemahs
  • 5
  • 2
  • 5
0
votes
1 answer

Add 25 & 30 as binary number

Using 8 bit registers and signed magnitude representation. I thought 25 in BCD is 010 0101 but my text book says it as 001 1001. Can somebody explain?
Sam
  • 69
  • 1
  • 4
  • 12
0
votes
1 answer

It's ok to use HEX as BCD function?

I'm wondering if it's ok to use HEX as BCD function? and for decoding we can take each character and decode it as decimal or byte..
Andrew
  • 1
  • 1
0
votes
1 answer

BCD to 7 Segment Decoder Schematic : Need help fitting in page

I am working on the schematic for a BCD to 7 segment decoder right now. I understand the logic, but it is the design of the schematic that I need help with. As you can see, I only have three outputs done and I need to add four more. The problem…
user1261852