Skip to content Skip to navigation

Connexions

You are here: Home » Content » Binary notation

Navigation

Recently Viewed

This feature requires Javascript to be enabled.

Binary notation

Module by: Don Johnson. E-mail the author

User rating (How does the rating system work?)
Ratings

Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

How to rate a module

Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

:
(0 ratings)

Summary: A short course on our friend, Base 2.

Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.

We need to concentrate on how computers represent numbers and perform arithmetic. Suppose we have twenty-six "things." This number is an abstract quantity that we need to represent so that we can perform calculations on it. We represent this number with positional notation using base 10: 26=2×101+6×100 26 21 60 . We could also use base-8 notation ( 328=3×81+2×80 32 3 8 1 2 8 0 ), base 16 ( 1A16=1×161+A16×160 1A 1 16 1 A 16 0 , with A16A representing ten), or base 2 ( 110102=1×24+1×23+0×22+1×21+0×20 11010 1 2 4 1 2 3 0 2 2 1 2 1 0 2 0 ). Each of these represent the same quantity; all numbers can be so represented and arithmetic can be performed in each system. Which we chose is a matter of convenience and cultural heritage. Each position is occupied by an integer between 0 and the base minus 1, and the integer's position implicitly represents how many times the base raised to an exponent is needed. The integer N N is succinctly expressed in base-b as Nb= d n d n 1 d 0 N d n d n 1 d 0 , which mathematically means Nb= d n bn++ d 0 b0 N d n b n d 0 b 0 . No matter what base you might choose, addition, subtraction, multiplication, and division all follow the same rules you learned as a child. These rules can be derived mathematically from the positional notation conventions defined by this formula. (Non-positional systems are very strange; take Roman numerals for example. Try adding (or, more extremely, dividing) two numbers using this number representation system). To extend the positional representation to signed integers, we add a symbol that represents whether the number is positive or negative.

Humans have ten fingers, and so it's not so surprising that many cultures throughout history have used base 10. Digital computers use base 2 or binary number representation, each digit of which is known as a bit (binary dig it). 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 binary addition and multiplication tables are

0+0=0 0 0 0 (1)
1+1=10 1 1 10 0+1=1 0 1 1 1+0=1 1 0 1 0×0=0 0 0 0 0×1=0 0 1 0 1×1=1 1 1 1 1×0=0 1 0 0

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

Exercise 1

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

Solution

25=110012 25 11001 and 7=1112 7 111 . We find that 110012+1112=1000002=32 11001 111 100000 32 .

Content actions

Give Feedback:

E-mail the module author | Rate module ( How does the rating system work?)

Rating system

Ratings

Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

How to rate a module

Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

(0 ratings)

Download:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.

| A lens (?)

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks