Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

How to addition

BYRTYRTYRTY__TRBYTRY
2,806 Views
0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
2,806 Views
0 Kudos
8 Replies
BYRTYRTYRTY__TRBYTRY
2,806 Views

Hello sir

please reply 

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,806 Views

You may find this useful: https://en.wikipedia.org/wiki/Binary_number

Jim Dempsey

0 Kudos
BYRTYRTYRTY__TRBYTRY
2,806 Views

1/9

 

 

hello 

How to write it in binary

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,807 Views

Use Google to find your answers.

    binary floating point

Gives:

https://ryanstutorials.net/binary-tutorial/binary-floating-point.php
https://www.youtube.com/watch?v=AU4DtxM9gb0
...

Jim Dempsey

 

0 Kudos
BYRTYRTYRTY__TRBYTRY
2,806 Views

Hello sir

how to find 1/9 floating point how to convert it in 10010.1010

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
2,806 Views

Binary is represented in powers of 2. 1/9 is a (decimal) fraction. You would convert this into a sum of binary fractions

1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128

To help identify which bit positions, first, as an example, compute 2^n / 9, where n is the number + 1 of significant bits of the precision of the result you want. Then look at the binary result and then place the binary decimal point to the left n bits. You can use the Programmer view of the Windows Calculator or locate one on the web. In Programmers view

For 32-bit fraction with decimal selected, enter: 1, Lsh, 32, =

Result: 4294967296 (decimal), 100000000000000000000000000000000 (binary)

Enter (in decimal mode): /, 9, =

Result: 477218588 (decimal), 00011100011100011100011100011100 (binary)

Insert "." 32 places to left of right most bit: .00011100011100011100011100011100
                                                                 0.00011100011100011100011100011100

As how to represent this in "floating point format", you will have to decide what format. There are many different formats that are used.

In anticipation of you asking....

15/9ths can be calculated with the Windows Calculator (32 bits)

1, Lsh, 32, *, 15, /, 9

Result: 7158278826 (decimal), 110101010101010101010101010101010 (binary)

Float decimal point 32 positions to left: 1.10101010101010101010101010101010

Jim Dempsey

0 Kudos
BYRTYRTYRTY__TRBYTRY
2,806 Views

Hello sir

How to add

           10001110100

          00011010000

        00111110100

......................................

...............................................

0 Kudos
BYRTYRTYRTY__TRBYTRY
2,806 Views

Hello sir

Which ic is used for addition 

0 Kudos
Reply