Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Is it true that binary coded decimal is used in most calculators and finance?

Status
Not open for further replies.

matrixofdynamism

Advanced Member level 2
Joined
Apr 17, 2011
Messages
593
Helped
24
Reputation
48
Reaction score
23
Trophy points
1,298
Activity points
7,681
BCD takes more bits to represent the same quantity that can be represented with much less memory using simple binary. However, I have come to know that BCD has certain advantages which cause it to be used in most calculators and finance applications. It has something to do with BCD representing numbers similar to radix 10.

Are BCD really superior to normal binary? Why? If so then why do we have normal binary arithmatic units in hardware and not binary coded decimal arithmatic units?
 

I have come to know that BCD has certain advantages which cause it to be used in most calculators and finance applications.
Any reference?

I know that first generation electronic desktop and pocket calculators (60th to begin 70th) often used BCD arithmetic, I doubt that recent calculators do.

It's mandatory for finance applications to use integer arithmetic. Since all modern processors and respective compilers support at least longlong (64 bit) integer number formats along with necessary decimal conversions, I don't see a reason why they should refer to BCD.
 

Hi,

BCD takes more bits to represent the same quantity that can be represented with much less memory using simple binary.
4 bits BCD --> 4 bits binary
8 --> 7
12 --> 10
16 --> 14
20 --> 17
24 --> 20
..
48 --> 40 the first time you really need 1 byte less...
You don´t safe that much.

****
Calculating in binary is more simple and faster for a microcontroller/processor.

****
BCD is rarely used compared to binary.

****
often one uses float:
* A 32 bit unsigned integer can represent values 0...4294967295, resolution 1
* a 32 bit signed integer an represent -2147483648 ...0 ... 2147483647, resolution 1
* a 32 bit float can represent about: -340000000000000000000000000000000000000 ... 0 ... 340000000000000000000000000000000000000,
with a smallest resolution 0.0000000000000000000000000000000000000000000015
(Maybe I missed/added a zero. Don´t care.. it just shows the huge dynamic.)
But the precision is limited to 23 bits (7..8 decimals)

Klaus
 

At one time if you were designing a very simple low cost single chip four function pocket calculator, where both keyboard entry, and display, both have to be in decimal, it all becomes simpler to do the number crunching in floating point BCD.

It makes no sense to convert to binary, then have to convert back again.
A four bit microcontroller is all simple early calculators often had.

However, a much more more powerful modern general purpose computer will do everything in binary.
Especially where there is some kind of high resolution display where there is no need to return the display data back to decimal format for driving individual seven segment displays.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top