answersLogoWhite

0


Best Answer

One-complement applies to binary values, not decimal values. Therefore when we say the ones-complement of a decimal value we mean convert the value to binary, invert all the bits (the ones-complement), then convert the result back to decimal.

For example, the decimal value 42 has the following representation in 8-bit binary:

00101010

If we invert all the bits we get 11010101 which is 213 decimal. Thus 213 is the ones-complement of 42, and vice versa.

However, it's not quite as straightforward as that because some (older) systems use ones-complement notation to represent signed values, such that 11010101 represents the decimal value -42. The problem with this notation is that the ones-complement of 00000000 is 11111111 which means the decimal value 0 has two representations, +0 and -0 respectively. In the real-world, zero is neither positive nor negative.

To resolve this problem, modern systems use twos-complement to represent signed values. The twos-complement of any value is simply the ones-complement plus one. Thus the ones-complement of 42 becomes -43, therefore the twos-complement of 42 is -43+1 which is -42. Thus -42 is represented by the binary value 11010110 in twos-complement notation.

With twos-complement, there is only one representation for the value 0. This is because the ones-complement of 00000000 is 11111111 and if we add 00000001 we get 00000000. Note that we don't get 100000000 because the result cannot have any more bits than were in the original value. When an "overflow" occurs, we cycle back to zero. As a result, incrementing and decrementing signed values has exactly the same logic as incrementing or decrementing unsigned values and flipping the sign of any value is only slightly more complicated by the extra addition operation. However, flipping the sign of a value is a much rarer operation than counting so the cost is trivial compared to the cost of counting operations using ones-complement (because there are two values for zero).

Note that ones-complement notation allows an 8-bit value to store signed values in the range -127 to +127, whereas twos-complement allows a range of -128 to +127 (through the elimination of the extra zero). But in unsigned notation, both allow the same range: 0 to 255.

Although we rarely encounter ones-complement notation, it is important to keep in mind that not all systems use twos-complement notation, particularly when working with low-level but portable programming languages. This is the reason why both the C and the C++ standards state that the range of an 8-bit signed value is only guaranteed to store values in the range -127 to +127.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is meant by ones-compliment of a decimal number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is 18 as a decimal number?

18 is already a decimal number. If you meant 1/8, then this is written in decimal notation as 0.125.


Is - 0.29292929292929 a rational number or an irrational number?

Any terminating decimal or repeating decimal is a rational number.-0.29292929292929 iseither a terminating decimal of the fraction -29292929292929/100000000000000or meant to be a recurring decimal (0.2929...) with the '29' recurring forever of the fraction 29/99Either way, it is a rational number.


Is 0.1575757. irrational number?

No, it is a rational number. It that is meant to be the terminating decimal 0.1575757: 0.1575757 = 1575757/10000000 If that is meant to be the recurring decimal 0.1575757... with the 57 repeating forever: 0.1575757... = 1/10 + 57/990 = 156/990 = 26/165


What is a demical equivalent to 0.18?

Try again! There is no such word as demical, and since the number is already in decimal form, I assume the word is not meant to be decimal!


What is a 55/100 as a decimal?

0.55


What is a number that contains a decimal point?

It is a number with a decimal point. It is not necessarily a decimal number because 24 (no decimal pont) is a decimal number.It is a number with a decimal point. It is not necessarily a decimal number because 24 (no decimal pont) is a decimal number.It is a number with a decimal point. It is not necessarily a decimal number because 24 (no decimal pont) is a decimal number.It is a number with a decimal point. It is not necessarily a decimal number because 24 (no decimal pont) is a decimal number.


What is 57 in decimal form?

A decimal number is simply a way of representing a number in such a way that the place value of each digit is ten times that of the digit to its right. A decimal representation does not require a decimal point. So the required decimal representation is 57, exactly as in the question.


Who invented the decimal number system?

Melvil Dewey created the Dewey Decimal system. It is a classification system used by libraries, and not what is meant in the question. The decimal number system is the number system that we all use on a daily basis; it was invented by a succession of Arab and Hindu mathematicians beginning about 1400 years ago.


Which number is larger 001 or 0005?

The 0005 is larger without a decimal points. If you meant .001 and .0005, the .001 is larger.


How do you work a terminating decimal?

The answer will depend on what is meant by "work a terminating decimal".


Is 13.001001001 a rational or irrational number and why?

A rational number is a number that can be expressed as a fraction. This means it can either be a terminating decimal or a recurring decimal. A terminating decimal is a decimal that doesn't recur (repeat for ever). A recurring decimal is a decimal that repeats a pattern of numbers after the decimal point. A good example of this is 1/3. 1/3 = 0.333333.... it is a rational number 13.001001001 is a rational number. Either you meant it to recur or not it makes no difference. 13.001001001 = 13 + 1001001/1000000000 as a terminating decimal 13.001001001....... = 12988/999 as a recurring decimal ---- Examples of numbers that are not rational: sqrt(2), pi, exp they are irrational as they cannot be expressed as fractions.


What is 916 as a decimal?

It is already expressed as a decimal in the form of 91.6