<< Chapter < Page Chapter >> Page >

Humans use base 10, commonly assumed to be due to us having ten fingers. Digital computers use the base 2 or binary number representation, each digit of which is known as a bit ( b inary dig it ).

Number representations on computers

The various ways numbers are represented in binary are illustrated. The number of bytes for the exponent andmantissa components of floating point numbers varies.
Here, each bit is represented as a voltage that is either "high" or "low," thereby representing "1" or "0,"respectively. To represent signed values, we tack on a special bit—the sign bit —to express the sign. The computer's memory consists of an orderedsequence of bytes , a collection of eight bits. A byte can therefore represent an unsigned number ranging from 0 to 255 . If we take one of the bits and make it the sign bit, we can make the same byte to representnumbers ranging from 128 to 127 . But a computer cannot represent all possible real numbers. The fault is not with the binary number system; rather having onlya finite number of bytes is the problem. While a gigabyte of memory may seem to be a lot, it takes an infinite number ofbits to represent . Since we want to store many numbers in a computer's memory, we are restrictedto those that have a finite binary representation. Large integers can be represented by anordered sequence of bytes. Common lengths, usually expressed in terms of the number of bits, are 16, 32, and 64. Thus, anunsigned 32-bit number can represent integers ranging between 0 and 2 32 1 (4,294,967,295), a number almost big enough to enumerate every human in the world! You need one more bit to do that.

For both 32-bit and 64-bit integer representations, what are the largest numbers that can be represented if a sign bit must also be included.

For b -bit signed integers, the largest number is 2 b 1 1 . For b 32 , we have 2,147,483,647 and for b 64 , we have 9,223,372,036,854,775,807 or about 9.2 18 .

Got questions? Get instant answers now!

While this system represents integers well, how about numbers having nonzero digits to the right of the decimal point?In other words, how are numbers that have fractional parts represented? For such numbers, the binary representation system is used, butwith a little more complexity. The floating-point system uses a number of bytes - typically 4 or 8 - to represent the number, but withone byte (sometimes two bytes) reserved to represent the exponent e of a power-of-two multiplier for the number - the mantissa m - expressed by the remaining bytes.

x m 2 e
The mantissa is usually taken to be a binary fraction having a magnitude in the range 1 2 1 , which means that the binary representation is such that d -1 1 . In some computers, this normalization is taken to an extreme: the leading binary digitis not explicitly expressed, providing an extra bit to represent the mantissa a little more accurately. Thisconvention is known as the hidden-ones notation . The number zero is an exception to this rule, and it is the only floating point number having a zero fraction. The sign of the mantissarepresents the sign of the number and the exponent can be a signed integer.

A computer's representation of integers is either perfect or onlyapproximate, the latter situation occurring when the integer exceeds the range of numbers that a limited set of bytes canrepresent. Floating point representations have similar representation problems: if the number x can be multiplied/divided by enough powers of two to yield a fraction lying between 1/2 and1 that has a finite binary-fraction representation, the number is represented exactly in floatingpoint. Otherwise, we can only represent the number approximately, not catastrophically in error as with integers.For example, the number 2.5 equals 0.625 2 2 , the fractional part of which has an exact binary representation. See if you can find this representation. However, the number 2.6 does not have an exact binary representation, and only be represented approximately in floating point. In single precision floating point numbers, which require 32 bits (one byte for the exponent and theremaining 24 bits for the mantissa), the number 2.6 will be represented as 2.600000079... . Note that this approximation has a much longer decimal expansion. This levelof accuracy may not suffice in numerical calculations. Double precision floating point numbers consume 8 bytes, and quadruple precision 16 bytes. The more bits used in the mantissa, the greater the accuracy. This increasing accuracy means that more numberscan be represented exactly, but there are always some that cannot. Such inexact numbers have an infinite binaryrepresentation. Note that there will always be numbers that have an infinite representation in any chosen positional system. The choice ofbase defines which do and which don't. If you were thinking that base 10 numbers would solve this inaccuracy,note that 1 3 0.333333.... has an infinite representation in decimal (and binary for that matter), but has finite representation in base 3. Realizing that real numbers can be only represented approximately is quite important, and underlies the entirefield of numerical analysis , which seeks to predict the numerical accuracy of any computation.

What are the largest and smallest numbers that can be represented in 32-bit floating point? in 64-bit floatingpoint that has sixteen bits allocated to the exponent? Note that both exponent and mantissa require a sign bit.

In floating point, the number of bits in the exponent determines the largest and smallest representable numbers.For 32-bit floating point, the largest (smallest) numbers are 2 ± 127 1.7 10 38 ( 5.9 10 -39 ). For 64-bit floating point, the largest number is about 10 9863 .

Got questions? Get instant answers now!

So long as the integers aren't too large, they can be represented exactly in a computer using the binary positionalnotation. Electronic circuits that make up the physical computer can add and subtract integers without error.(This statement isn't quite true; when does addition cause problems?)

Computer arithmetic and logic

The binary addition and multiplication tables are

0 0 0 0 1 1 1 1 10 1 0 1 0 0 0 0 1 0 1 1 1 1 0 0

Note that if carries are ignored, A carry means that a computation performed at a given position affects other positions as well. Here, 1 1 10 is an example of a computation that involves a carry. subtraction of two single-digit binary numbers yields the samebit as addition. Computers use high and low voltage values to express a bit, and an array of such voltages express numbersakin to positional notation. Logic circuits perform arithmetic operations.

Add twenty-five and seven in base 2. Note the carries that might occur. Why is the result "nice"?

25 11011 and 7 111 . We find that 11001 111 100000 32 .

Got questions? Get instant answers now!

The variables of logic indicate truth or falsehood. A B , the AND of A and B , represents a statement that both A and B must be true for the statement to be true. You use this kind of statement to tell searchengines that you want to restrict hits to cases where both of the events A and B occur. A B , the OR of A and B , yields a value of truth if either is true. Note that if we represent truth by a "1" andfalsehood by a "0," binary multiplication corresponds to AND and addition (ignoring carries) toXOR . XOR, the exclusive or operator, equals the union of A B and A B . The Irish mathematician George Boolediscovered this equivalence in the mid-nineteenth century. It laid the foundation for what we now call Boolean algebra,which expresses as equations logical statements. More importantly, any computer using base-2 representations andarithmetic can also easily evaluate logical statements. This fact makes an integer-based computational device much morepowerful than might be apparent.

Questions & Answers

What is inflation
Bright Reply
a general and ongoing rise in the level of prices in an economy
AI-Robot
What are the factors that affect demand for a commodity
Florence Reply
differentiate between demand and supply giving examples
Lambiv Reply
differentiated between demand and supply using examples
Lambiv
what is labour ?
Lambiv
how will I do?
Venny Reply
how is the graph works?I don't fully understand
Rezat Reply
information
Eliyee
devaluation
Eliyee
t
WARKISA
hi guys good evening to all
Lambiv
multiple choice question
Aster Reply
appreciation
Eliyee
explain perfect market
Lindiwe Reply
In economics, a perfect market refers to a theoretical construct where all participants have perfect information, goods are homogenous, there are no barriers to entry or exit, and prices are determined solely by supply and demand. It's an idealized model used for analysis,
Ezea
What is ceteris paribus?
Shukri Reply
other things being equal
AI-Robot
When MP₁ becomes negative, TP start to decline. Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of lab
Kelo
Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of labour (APL) and marginal product of labour (MPL)
Kelo
yes,thank you
Shukri
Can I ask you other question?
Shukri
what is monopoly mean?
Habtamu Reply
What is different between quantity demand and demand?
Shukri Reply
Quantity demanded refers to the specific amount of a good or service that consumers are willing and able to purchase at a give price and within a specific time period. Demand, on the other hand, is a broader concept that encompasses the entire relationship between price and quantity demanded
Ezea
ok
Shukri
how do you save a country economic situation when it's falling apart
Lilia Reply
what is the difference between economic growth and development
Fiker Reply
Economic growth as an increase in the production and consumption of goods and services within an economy.but Economic development as a broader concept that encompasses not only economic growth but also social & human well being.
Shukri
production function means
Jabir
What do you think is more important to focus on when considering inequality ?
Abdisa Reply
any question about economics?
Awais Reply
sir...I just want to ask one question... Define the term contract curve? if you are free please help me to find this answer 🙏
Asui
it is a curve that we get after connecting the pareto optimal combinations of two consumers after their mutually beneficial trade offs
Awais
thank you so much 👍 sir
Asui
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities, where neither p
Cornelius
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities,
Cornelius
Suppose a consumer consuming two commodities X and Y has The following utility function u=X0.4 Y0.6. If the price of the X and Y are 2 and 3 respectively and income Constraint is birr 50. A,Calculate quantities of x and y which maximize utility. B,Calculate value of Lagrange multiplier. C,Calculate quantities of X and Y consumed with a given price. D,alculate optimum level of output .
Feyisa Reply
Answer
Feyisa
c
Jabir
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Fundamentals of electrical engineering i. OpenStax CNX. Aug 06, 2008 Download for free at http://legacy.cnx.org/content/col10040/1.9
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Fundamentals of electrical engineering i' conversation and receive update notifications?

Ask