The Gateway to Computer Science Excellence

+8 votes

Best answer

0

No - you converted numbers to decimal and added which is correct for normal decimal numbers written in binary. But BCD means numbers are already decimal but coded in binary. 0x14 = 14 because in BCD, we cannot have A-F and hence hex number is same as decimal.

0

corrected

but 2 question

is 0x14 and 0x08 are BCD number?

And 2nd question is it is asking for binary representation

but answer coming in Hex

0

How did you convert hex-decimal no into binary with unknown variable x.

it seems like you did simple decimal addition not BCD addition

in BCD it should be like this

0000 x 0001 0101

0000 x 0000 1000

--------------------------------------

0000 x 0001 1101

as far as i know about BCD addition it should be like this .But i m not quite sure how to write x. Correct me if i m wrong.

it seems like you did simple decimal addition not BCD addition

in BCD it should be like this

0000 x 0001 0101

0000 x 0000 1000

--------------------------------------

0000 x 0001 1101

as far as i know about BCD addition it should be like this .But i m not quite sure how to write x. Correct me if i m wrong.

+3

@shekhar - x is not unknown- 0x means hex coded - 4 bits of binary being represented using a hex digit to make it more readable.

Now, in your answer you have to add '6' as the result is over 9 for the least significant digit addition as per rule of binary addition for BCD.

And yes we can simply do decimal addition because that is what is asked in question :)

Now, in your answer you have to add '6' as the result is over 9 for the least significant digit addition as per rule of binary addition for BCD.

And yes we can simply do decimal addition because that is what is asked in question :)

0

Thanks . I have to learn a lot.

But why he has written that addition of these 2 no's in binary is 22

in binary a no has base 2. how come a no 22 be in binary .it should be represented in either 0 or 1

0

@Arjun sir , it is a packed BCD concept rt?

http://imrannazar.com/Binary-Coded-Decimal-Addition-on-Atmel-AVR

http://imrannazar.com/Binary-Coded-Decimal-Addition-on-Atmel-AVR

+11 votes

as far I know we need to add a correction of 6 whenever the sum in BCD addition is greater than 9.

0x14 --> 0001 0100

0x08 --> 0000 1000

---------------------------------

1100 (sum of last 4 bits)

0110 (add correction 6)

------------------------------------------

0010 0010 --------------> 0x22

--------------------------------------------------

+3 votes

0** x **means the numbers are given in hexadecimal format.

Now 0x14 means it's simple 14 and not E iin hexadecimal.

so writing BCD of 14 = 0001 0100

BCD of 8 = 0000 1000

Adding above two gives 0001 1100

Now since there is an overflow in the LSB (8+4) part of the numbers, add 0110( decimal equivalent 6) to this as per bcd rules of addition.

0001 1100

0000 0110

Adding gives 0010 0010

which is 22 in BCD.

and so in hexadecimal each digit of BCD can be represented directly.

so Answer **0x22 Option (A)**

0 votes

I think answer should be c...

A=0x14

b=0x08

Addition= 0x1(12)=0x1c

according to BCD packed number as per this tutorial

0 votes

0x14 = 0001 0100 (These numbers are not simple binary, but BCD, ie, they represent decimal values) = 14

0x08 = 0000 1000 = 08.

Add 14 and 8 = 22. 22 in BCD is 0010 0010 (each digit is encoded to equivalent binary)

0010 0010 = 0x22

**Option A**

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,390 answers

198,589 comments

105,443 users