Introduction to umber ystems

60
Introduction to umber ystems By fOREST BElT Author and Consultant Computer Diagnostics

Transcript of Introduction to umber ystems

Page 1: Introduction to umber ystems

Introduction to umber ystems

By

fOREST BElT

Author and Consultant Computer Diagnostics

B0802-2

Edition 1

All terms mentioned in this text that are known to be trademarks or service marks have been appropriately capitalized. Use of a term in this text should not be regarded as affecting the validity of any trademark or service mark.

Copyright © 1982 by Penn Foster, Inc.

All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the copyright owner.

Requests for permission to make copies of any part of the work should be mailed to Copyright Permissions, Penn Foster, 925 Oak Street, Scranton, Pennsylvania 18515.

Printed in the United States of America

Reprinted 1987

Page 2: Introduction to umber ystems

I tr ti t r

Instructional Objectives

It sometimes seems as if electronics and mathematics belong together. As industrial machines rely more and more on logic systems and computer control, they also lean more and more heavily on numbers. You don't have to be a mathematician to cope with modern industrial equipment; but to some degree, you must understand numbers.

This lesson will take you through four number systems: decimal, binary, hexadecimal, and octal. Computer-based and digital electronics systems involve them all. And after you've completed this lesson, you should be able to:

• Explain the binary numbering used by computers and digital electronics equipment.

• Understand hexadecimal notation as is used in machine-language programs.

• Recognize octal numbers, and know how they're used.

• Count in binary, octal, and hexadecimal numbers.

• Convert values from one number system to another.

• Perform simple calculations in all four number systems.

• Explain the main advantage of the binary-coded decimal (BCD) system as compared with the ordinary binary number system.

Page 3: Introduction to umber ystems

Contents

What a Number System Is

Learning to Count Properly Numbers Also Represent Values Systems of Numbering Why More Than One Number System? Concepts ofPosition Value

Decimal Numbering: Base 1 0

How Decimal Numbering Evolved What Base 10 Means Metric Measurement and Decimal Numbering Position Values and Scientific Notation Adding and Carrying in Base 10 Subtracting and Borrowing in Base 10 Borrowing from Zero Check Y ou:r I...ea:rning 1

Binary Numbering: Base 2

Concepts of Binary Numbers Uses for Binary Values Counting in Base 2 Position Notation for Base 2 Binary Adds and Carries Binary Subtracting and Borrowing One's and Two's Complement Converting Binary to Decimal From Decimal to Binary Another Way to Get to Base 2 from Base 10

Binary-Coded Decimal (BCD) Numbers

Zero to Nine in Nibbles Larger BCD Numbers BCD Mathematics 'VH!Co.:;n. y OU:r 2

1 1 2 3 3

6 7 7 8 9

10 11 13

14 14 15 16 17 19 20 22 24 26

28 28 29 32

Page 4: Introduction to umber ystems

Hexadecimal Numbering: Base 16 From 0 to Fin Base 16 Counting Higher in Hexadecimal Binary to Base 16 by Nibbles Base 10 to Hex by Modulo Division Recognizing Hexadecimal Data Hex to Decimal by Position Hex Arithmetic the Easy Way Base-16 Subtraction and Proof

Octal Numbering: Base 8

Counting in Octal Binary Triads Equal Base 8 Octal to Hex via Base 2 Octal to Base 10 and Back Octal Arithmetic Split-Octal Concept

Self-Test

Self-Test Answers

33 33 35 37 39 40 41 42

44 45 45 46 47 48

53

56

Page 5: Introduction to umber ystems

lJ Learning to Count Properly

Of all of the uses for numbers, the most prevalent is count­ing. Anyone discussing more than one of something natu­rally specifies "how many."

In counting, you enumerate items one by one. Each item adds one to your count. You call off numbers, to represent your tally at each step - whether you're a football referee counting off the yards of a penalty, or a housewife counting out dollar bills at the checkout counter.

Youngsters learn early to recite "one, two, three, four, five, six, seven, eight, nine." In that sequence, each number represents one more than the preceding number. In addition to words, symbols represent these numbers: 1, 2, 3, 4, 5, 6, 7, 8, and 9.

People who count often ignore the number zero, shown by the symbol 0. A count stands at zero when there is no item or no object. Correct counting begins with zero. Once you realize that counting involves adding 1 to each previous number, you can accept a start from zero items to arrive at a tally of 1. Hence, ordinary counting, if you do it right, actu­ally goes: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Remember the zero. It occupies a vital position in every counting system.

~ Numbers Also Represent Values

Numbers contribute to another concept: measurement. Strictly speaking, measuring is a form of counting. Yet we seldom think of if that way.

For example, you might measure length by saying (or thinking): "0 feet (the start), 1 foot, 2 feet, 3 feet, 4 feet, 5 feet." But you'd report the tally as a number representing the total, and you'd ask the man at the lumberyard for "five feet of white pine."

1

Page 6: Introduction to umber ystems

2

Or, suppose you're buying a few gallons of gasoline for your car. Your attention centers on the quantity, not the count. You don't say, "I want one, two, three, four, five gal­lons." You say, "Give me five gallons."

In these examples, the number 5 represents measured quantities. To attain a particular value, a definite number of units (one-counts) must be added to zero (no) units. But the counting itself usually remains invisible - not noticed at all.

In electronics, we deal with numbers or values built on units of electrical measurement: volts, ohms, amperes, watts, hertz, to name a few. You'll find it useful to remember that the numeric values resulting from your measurements represent a tally of counts - that when you measure five hundred volts, say, your meter has, in effect, counted each volt and reported a tally of the total units present.

® Systems of Numbering

Any method of counting involves three things: its starting value, its increment, and the total of different numerals it uses.

All number systems common to electronics start with the value zero, symbolized by 0. Furthermore, in each the counting increment is one, or 1. Every step or count consists in adding a unit (1) to whatever count or value is "current."

What distinguishes one electronics number system from another, then, is the matter ofhow many numeral symbols it incorporates. This quantity is called the base of the number system.

Your studies in this lesson cover four number systems:

1. Decimal, or base 10 2. Binary, or base 2 3. Hexadecimal, or base 16 4. Octal, or base 8

In each instance, the base indicates the number of differ­ent digits in the system. Decimal numbering has ten digits to pick from: 0 through 9. Binary uses only two: 0 and 1.

Page 7: Introduction to umber ystems

~ Why More Than One Number System?

Each number system described above has its own unique place in electronics.

Decimal numbers - the kind you use every day - ap­pear mostly in linear or analog electronics.

Binary numbers are the language of digital electronics. Hexadecimal and octal number systems serve mainly as

shorthand notations for binary numbers. You'll discover that, vital as binary numbering is, its larger values are difficult to read and remember. Computers and digital elec­tronic instruments read binary numbers easily; in fact, in their inner workings, they understand no other kind. But humans find lengthy binary numbers hard to decipher. to

or

@ Concepts of Position Value

Using only one position in a number system, you can't count beyond the value of the highest digit: in decimal, for exam­ple, you could count only to 9. So you need some means to ex­tend your counting ability to higher values.

Number systems draw on the concept of position value to solve this problem. You're already familiar with base-10 (or decimal) numbering, since you use it daily. Four decimal positions and their values are illustrated in Fig. 1.

Rightmost is the units position, in which values stand for multiples of one. This is the least significant position in a decimal number. Starting from zero, you can count as far as 9 in this first position.

One count higher than 9 sets the units position to zero and "carries" one count into the next position. This is called the tens position, and 10 is its position value.

Fig. 1. The location of each digit in a horizontal number takes on positional significance- that is, it has a value related to its position (in addition to its own value). As part of a total count, a digit is actually worth its position value multiplied by its own value.

3

Page 8: Introduction to umber ystems

4

Now the units position can be incremented, again as far as 9. The total value then stands at what we've learned to cal1 "nineteen"- a 1 in the tens position and a 9 in the units position.

To count further, the units position reverts again to 0 and another carry accumulates in the tens column. That makes the count for tens rise to 2. We call this tally "twenty" and recognize it from its symbol, a 2 and a 0: 20.

If the incrementing (counting) continues far enough, you eventually accumulate highest-value digits in both posi­tions: you reach 99, meaning 9 tens and 9 units. The word "ninety-nine" describes this value.

At this point, a count of 1 added to 9 in the units position causes units to start over again with 0, and adds 1 to the tens. Adding 1 to a 9 already in the tens position reverts tens to 0 and forces a carry to the next leftward position, which is hun­dreds. You see the result as 100, and call it "one hundred."

You can total up to 99 more counts before the hundreds position increments again. Upon each succeeding count of 99, one more count forces another carry into the hundreds position, incrementing it.

Each position in a decimal numbering system can take numerals from 0 to 9. When another count is added to a posi­tion that's already 9, the digit "turns over" to 0 and forces a carry into the next leftward column - called the next more significant position. When a total count reaches 999, adding 1 turns units to 0 and forces a carry into the tens; which turns to 0 and generates a carry into the hundreds; which becomes zero and pushes a carry into the thousands position. (You've probably seen it happen on the odometer of your car when "the zeroes come up"!)

Each column thus has a position value. In the least sig­nificant position, value is 1. That is, the value of this position in a number is 1 times whatever digit you see there, since the digit was accumulated by counts of 1.

The second position value is 10. Each count there is reached after an accumulation often counts in the units posi­tion. (Don't forget that 0 is always part of each count.)

The value of the third position is 100. Each count at this position was caused by a hundred total counts (0 through 99) in the units/tens column.

The most significant position shown in Fig. 1 carries a value of 1000. Only after counts from 000 to 999 does this

Page 9: Introduction to umber ystems

position increment. And only after all four positions have reached 9, for a total of9999, will a carry be forced into the next more significant position.

You probably knew these effects before you began this lesson. However, it's vital that you understand just how each position value is derived in decimal numbering. It he]ps ex­plain position values in other number systems.

5

Page 10: Introduction to umber ystems

6

g:

How Decimal Numbering Evolved

Og killed only enough to feed himself and his family. One day, others moved in nearby, and Og shared his food with them. One bear didn't last long, though, so the next time Og killed two. But they were too much to drag home without help.

When he reached the caves, he smashed his ax against the ground, held up two fingers, and pointed back down the trail. A couple of the neighbors understood, went out, and pulled the meat home. Since Og was a top-notch hunter, he soon undertook to supply the whole cliffside. He thus escaped berry picking, which he hated.

One day, at the end of three days' hunting, Og had killed more bears than he had fingers. So he pounded his ax on the ground once and held up all ten fingers. Then he pounded once more, and again held up all ten fingers. He finished by holding up six fingers. The food-haulers understood: twenty­six stalwart cave-dwellers went out to drag the kill home.

Ever since, their descendants have counted large quan­tities in groups of ten. Two or three or more fingers continue to represent numbers in between the tens. As commerce grew, tally sticks replaced ax strokes as "ten-markers." Then, fire was discovered, and marks with charred wood re­placed finger-and-stick counting. Soon, ten-system counting was second nature. (A mathematician named Simon Stevin is credited with formalizing decimal arithmetic, in 1585.)

The term decimal came originally from the Latin de­cimas, and referred to a one-tenth part or portion. Around 1760, however, the arbiters of language allowed that deci­mal could also be considered as rooted in the Latin word decem, meaning ten.

Either root fits. In decimal numbering, each next more significant position carries a value ten times greater. And value at the next lesser position is one-tenth as great.

Page 11: Introduction to umber ystems

What Base 10 Means A few summarizing remarks on the subject ofbase 10 should clarify the concept for you:

1. Base 10 refers to the ten numerals or digits available for counting in the system.

2. For this ten-digit number system, known as the deci­mal system, most languages of the world use ten Arabic numerals: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

3. Any numeral position in a large decimal value is worth ten times the value of the position on its right, and one-tenth the value of the position to its left.

4. Moving leftward from a decimal point (.), position values are units, tens, hundreds, thousands, ten thousands, hundred thousands, millions, and so on.

5. Moving rightward from a decimal point, position val­ues for decimal fractions are tenths, hundredths, thousandths, ten-thousandths, and so on.

Fig. 2 lists these values, to fifteen places in each direction from zero.

Metric Measurement and Decimal Numbering

A few people mistakenly talk of"metric numbering" as if it were the same as decimal. It isn't.

Metric isn't a number system at all. Metric refers to a system of measurement related to the length of one meter. Metric values seem to relate to decimal numbering because they're expressed in base-10 multiples or fractions. Metric prefixes, mostly of Greek and Latin origin, signify ten-based multiples or tenth-based fractions- for example, kilometer, or one thousand meters; and centimeter, or one-hundredth meter.

HUNDRED TRILLIONS TEN TRILLIONS TRILLIONS

- + HUNDRED BILLIONS TEN BILLIONS BILLIONS

- + HUNDRED MILLIONS TEN MILLIONS MILLIONS

+ HUNDRED THOUSANDS TEN THOUSANDS THOUSANDS

- + HUNDREDS TENS UNITS

+ DECIMAL POINT

+ TENTHS HUNDREDTHS THOUSANDTHS

> + TEN-THO US AN DTHS HUNDRED-THOUSANDTHS MILLIONTHS

> + TEN-MILLIONTHS HUNDRED-MILLIONTHS BILLIONTHS

> + TEN-BILLIONTHS HU NOR ED-81 LLIONTHS TRILLIONTHS

TEN-TRILLIONTHS HUNDRED-TRILLIONTHS (and so on)

Fig. 2. For ease of interpretation, commas divide whole numbers (numbers left of the decimal point) into groups of three, if the number exceeds 999. Fractions (numbers right of the decimal point) don't take commas. However, you can draw carets ( 1\ ) to mark off positions in fractions.

7

Page 12: Introduction to umber ystems

8

Electronic measurements, particularly in analog cir­cuitry, follow the decimal (rather than the metric) conven­tion. Table 1lists some prefixes common in electronics. They may apply to volts, ohms, amperes, hertz, farads, henrys -to almost any electronic quantity. About the only metric unit in electronics is used to measure wavelength, which is ex­pressed in terms of meters or fractions thereof.

@ Position Values and Scientific Notation

You've now seen, in Fig. 2 and Table 1, several notations for decimal values. Fig. 2 illustrates notation carried to one hundred trillion. That's 15 positions. Five hundred trillion is written with a 5 followed by 14 zeroes: 500,000,000,000,000.

A decimal shorthand called scientific notation expresses position value through an exponent, or power of 10. In scien­tific notation, five hundred trillion is written as 5 x 1014.

You'd read this as "five times ten to its fourteenth power." As you learned in mathematics, this notation makes huge num­bers much· easier to manipulate. If you wanted to convert this example back to decimal, you'd just write the 5 and fol­low it with the number of zeroes indicated by the exponent of 10 (14, in our example). To put it another way: you'd move the decimal point 14 places rightward.

Page 13: Introduction to umber ystems

The same thinking that informs scientific notation can help you evaluate all base-10 numbers. Try this: From some large number, such as your employee number or telephone number, pick out a digit whose position value you want to de­termine. Start with the next digit on its right, and count po­sitions rightward, stopping at the decimal point. On scratch paper, write a 1 and follow it with as many zeroes as posi­tions you counted. This, in decimal, is the position value of the digit you picked.

In Fig. 3, the value of the 1 is 100 million; of the 3, 10 million; of the 4, 1 thousand; and of the 7, 100 thousand. Total value, therefore, is one-hundred-thirty million, seven­hundred-four thousand.

lJ@ Adding and Carrying in Base 10

You saw examples of carrying in the first section of this les­son when you studied the proper way to count. You must un­derstand the concepts behind carries in decimal adding, since you'll soon be applying them to other number systems.

Fig. 4 demonstrates simple base-10 addition. In the units position, 4 and 8 sum up to more than 9, the highest digit value in base 10. Think this way: From 8, one count makes 9. to 0

Two more incre­ments raise the units digit to 2. So call this "2 and carry 1."

In the tens position, 5 and 2 make the total count 7. The carry from units (1) brings the count to 8. This is inside the digit range of a base-10 position, so it produces no carry.

In the hundreds position, 6 counts added to 6 pushes the sum for that position past 9 again- to 12 or "2, carry 1." The hundreds-position sum, therefore, is 2, with a carry of 1

Fig. 3. You can evaluate a number by establishing the position values of its nonzero digits, then multiplying those values by the digits' own values. This technique is also a basis for interpreting numbers in systems other than decimal.

6 2 8 r 6 5 4

I 2 8 2

AUGEND ADDEND SUM

Fig. 4. Addition may seem simple with decimal values. But learn to keep careful track of carries - they are crucial to calculations in other number systems.

9

Page 14: Introduction to umber ystems

Fig. 5. Master this method of subtraction, including the habit of writing the minuend values that result from borrows. Even if you can manage decimal subtraction by memory, bear in mind that other number systems won't be that familiar and you'll be glad to have this method to rely on.

10

going to the thousands spot. And, since no augend or addend appears in the thousands position, the carry of 1 becomes the thousands sum. (An augend is the number to which a new quantity, called the addend, is to be added.)

Having used decimals for years, you probably think, "6 and 6 are 12; put down the 2 and carry the 1." This, too, is ap­propriate. However, the one-count-at-a-time approach will prepare your thinking for the number systems other than base 10 that you'll soon be studying.

Subtracting and Borrowing in Base 10

Subtraction in unfamiliar number systems confuses some technicians. Techniques of subtraction seem to vary accord­ing to what school you attended. For the sake of simplicity, though, try to master the method of Fig. 5: it adapts readily to other number systems.

4 7 " 5

1 6 3 8 3

4 q I 52

4 9 q t4 I I rjiJ{(jlf'Jt

-4 9 2 5 1 3

007908

(a)

(b)

MINUEND SUBTRAHEND

DIFFERENCE

MINUEND SUBTRAHEND

DIFFERENCE

Subtraction at the least significant or units position in Fig. 5(a) is easy, since the minuend of 5 is larger in value than the subtrahend. Also, the difference is only two counts. Write 2 for the difference.

At the tens position, you can't subtract the larger sub­trahend from a smaller minuend. You must therefore borrow one count from the next most significant position. Remember these two rules ofborrowing:

Page 15: Introduction to umber ystems

' Rule 1. A borrow increases the value of the digit bor­rowed by the value of the system base.

A borrow decrements the value borrowed from (reduces it by 1 J.

So, the tens-position minuend 3, thanks to the borrow, ac­quires a working value of 13. The hundreds-position minuend 5 is lowered to a value of 4. To help you remember these two points, write a small13 above the tens position and a 4 above the hundreds. Cross out the original 3 and 5 in those positions.

A difference of5 counts exists between 8 and 13. Write 5 as the difference at the tens position. For the hundreds, there is a count of 1 between 3 and 4, so 1 goes into the answer at that position.

For thousands, you again have a subtrahend larger than the minuend. Borrow 1 from the ten-thousands position. The thousands minuend now becomes 15, since the borrowed 1 is really worth 10 in the thousands column. Borrowing also de­crements the minuend value from 6 to 5. A 6 count sub­tracted from 15 leaves 9 as the difference. Finally, in the most significant position, a count of 1 from 5 leaves 4. Write that value on the difference line.

This explanation may seem somewhat elaborate, espe­cially if you're already good at subtraction. But master this two-step borrowing procedure: it will prove invaluable when you work with other number systems.

lJ~ Borrowing from Zero

Another type of borrowing situation occurs in Fig. 5(b). Sub­tractions at the units and tens positions work as just de­scribed. The results are an 8 for units and a 0 under tens.

A count of 5 cannot be subtracted from the 4 in the hun­dreds minuend, so borrowing becomes necessary again. The problem is, you cannot borrow from the thousands minuend, because it is 0. So you move to more significant positions, until you find a digit value you can borrow from- in this ex­ample, at the hundred-thousands position.

11

Page 16: Introduction to umber ystems

12

But another difficulty crops up: you can borrow only for an adjacent position. So, the 1 borrowed from the 5 minuend at the hundred-thousands position (decrementing it to 4) can apply only to the ten-thousands minuend, which now be­comes 10. However, you can then borrow from that to satisfy the thousands column, leaving a value of 9 as a working minuend for ten thousands and making the thousands minuend 10. Then, for the hundreds minuend, you borrow 1 from the thousands minuend, leaving only 9 there. The hun­dreds minuend now becomes 14, giving you the sufficiently large minuend you needed in the first place.

It may seem fairly complicated, but a third rule of bor­rowing simplifies the procedure:

When you encounter a zero adjacent to the digit you must borrow for, borrow instead from the next more sig­nificant nonzero digit, decrementing its value by 1. Then, change all intervening zeroes to the highest digit value the number system allows.

This rule works for any number system. Back in Fig. 5(b), subtracting 5 from 14leaves a value of

9 as the difference. The next two positions are easy: because of the borrowing/decrementing sequence, both minuends have become 9. At the thousands position, 2 from 9leaves 7. At the ten-thousands position, 9 from 9 leaves zero.

At the hundred-thousands position, the earlier borrow decremented the minuend 5 to a value of 4. So, 4 minus 4 leaves 0. In the answer, the leading zeroes can be marked off and ignored- for a difference of 7908.

Page 17: Introduction to umber ystems

Check Your Learning 1

You should pause in your studies occasionally to examine your under­standing of the introductory material on number systems. (It also gives you a little break from the work.) Check your answers to the following questions against ours; if they don't agree, reread the indicated arti­cles and try again.

1. Name at least three of the four number systems common to elec­tronics.

2. The base used for binary numbering is __ _

3. Which of the following best corresponds to the term increment in number systems? A. One place farther left in the value positions B. One place farther right in the value positions C. One count higher for the value D. One count lower for the value

4. Work the following subtraction problem, writing in changes in minuend values caused by borrowing and decrementing.

6 0 0 2 9 -54231

5. What is meant by the term decrement in number systems? A. One place farther left in the value positions B. One place farther right in the value positions C. One count higher for the value D. One count lower for the value

Answers to Check Your Learning 1 ~ ~ "lJV anreA 94l JOJ J9MOJ JUnoo 9U0 ·a ·g

9 b lS ~ £ <: p g

6Z/J/J...9 ?'I b b 5

~ ~ ' ~ ~ '6 "SlJV ·v s '& "SlJV ante/\ 941 JOJ J946!4 tunoo euo ·a ·c

~ -~

18100 teW!oapeX9H

Aleuts 1ewtoaa

(IJUJMOJIOJ 81./J JO 88Jl.fl AU\t) . ~

13

Page 18: Introduction to umber ystems

14

Binary Numbering: Base2 lJ® Concepts of Binary Numbers

Binary means "having two distinct parts." Binary values consist of numbers made up from two digits: 1 and 0. With two digits available, binary is referred to as a base-2 number system.

The lowest value in the number system is 0, as it is in the other number systems this lesson covers. For counting, the increment- also as usual- is 1.

In base-2 (or binary) numbering, the highest digit value is 1. Hence, only a 1 or a 0 can occupy any position in any binary number. Because of the way this looks, binary numbering is occasionally nicknamed "one-zero" number­ing.

Uses for Binary Values

Why bother with a base-2 number system? One reason has its roots in decision-making logic. When a decision can be re­duced to a choice between yes or no, the decision is said to be binary - that is, having two distinct parts, and only two. Sometimes the terms true and false take the place of yes and no. In any case, any choice that narrows down to no more than two alternatives can be a binary decision.

Many electronic devices practice yes/no (or true/false) decision-making. To represent the choices, binary values 1 and 0 are commonly used. In general, 1 symbolizes yes, with 0 the symbol for no- although this isn't always the case.

The word digital, as used in the term digital electronics, relates to its dependence on bimiry-logic devices. A digital electronic signal looks like a sequence of upright pulses (ones) separated by a zero-level baseline (zeroes). Digital­logic circuitry thus depends on the two-digit system to por­tray its values and conditions. Logic devices operate solely on binary digits.

Page 19: Introduction to umber ystems

) Since measuring methods developed historically within

the context of decimal numbering, special techniques had to be developed to convert so-called analog measurements to a binary format. Typically, such methods depend on principles ofbase-2- or binary- numbering.

lJ.@ Counting in Base 2

As we've seen, any number is produced by the principles of counting. Commencing with zero, a count increments the LSD (least significant digit) until it reaches the highest value allowed by the number system. Incrementing again then turns the LSD to 0, and a carry increments the next more significant digit.

You can follow the steps of binary counting in Fig. 6 (see page 16). Of course, you begin with 0 at the first or LSD posi­tion. Counting 1 raises the LSD value to 1. This is the high­est single-digit value permissible in base 2. One more count returns the LSD value to zero and generates a carry into the next position. Symbols for this binary number now read 10, pronounced "one-zero" or sometimes "one-oh." (Note that base-2 also talks- as well as counts- only in terms of 1 and 0. Thus we say "one-zero" or "one-oh"- never "ten." There just ain't no such animal as "ten" in binary cou~ting.)

Another count increments the LSD again, and the result is 11, pronounced "one-one." Still another count returns the LSD to 0, and generates a carry. This carry into the second position, which already contains a 1, sends that digit also to 0, with a carry into the next or third position. The binary value becomes 100- pronounced "one-zero-zero," of course.

Continued counting produces:

Increment first position, with result 101. Increment first position to zero and carry, with result

110. Increment first position, with result 111. Increment first position to zero and carry,

increment second position to zero and carry, increment third position to zero and carry, with result 1000 ("one-zero-zero-zero").

Counting in Fig. 6 continues as far as the binary value 1111.

15

Page 20: Introduction to umber ystems

Fig. 6. Counting in binary involves simple incrementing and carrying. Having only two digit values to work with -1 and 0-base-2 numbers grow long fairly quickly.

16

The fifteen binary values shown correspond to decimal numbers 0 through 15.

lJ® Position Notation for Base 2

The position of digits in multiple-digit values can be indi­cated more directly. The rightmost digit-known also as the least significant digit, as you know- takes position number

(

Page 21: Introduction to umber ystems

0. You call it the "zeroth" digit or digit 0. The next digit to the left takes position number 1; call it digit 1. The next leftward digit is digit 2; the next, digit 3; the next, digit 4; and so on.

Another word is used to describe binary digits: bit. This word comes from condensing the two words "binary digit." Instead of calling the ones and zeroes in Fig. 6 "digits," there­fore, call them bits - and start thinking of them that way, too.

Accordingly, positions for this 8-bit binary value start at the least significant bit {lsb) as bit 0. Next comes bit 1, then bit 2, then bit 3, and so on, through bit 7, which is the most significant bit (msb).

Note. Abbreviations for bits use lowercase letters, not up­percase as for digits or- as you'll find out later- for bytes.

Hereafter, these lessons will identify digits in binary values by their bit numbers.

lJI? Binary Adds and Carries

Having already studied decimal addition, with its carries, you should find adding binary (base-2) numbers a snap.

Bit addition generally goes best if you confine your at­tention to no more than two values at a time. With more, a problem arises quickly from the complexity ofbase-2 carries. With only two digits available, multiple carries grow confus­ing as they accumulate.

Here are four rules for binary addition:

Rule 1. 0 + 0 = 0

2.1+0=1

1 + 1 = 0 carry 1

1 + 1 + 1 = 1 and carry 1

17

Page 22: Introduction to umber ystems

Fig. 7. Keeping track of carries in binary addition demands painstaking accuracy. Remember that summing may generate a carry outside the limits of the numbers being added. This carry, too, must be accounted for, if the sum is to be used in subsequent binary calculations.

18

The exercises in Fig. 7 will help clarify the techniques ofbi­nary (or bit) addition, as well as provide some practical appli­cation of these four rules.

Fig. 7(a) adds the two binary values 10011011 and 10001101. At bit 0, 1 and 1 equal 0 and force a carry to bit 1. For the bit 1 position, 1 and 0 make 1, and the carried 1 brings the value to 0 with a carry into bit 2. Bit 2, including the carry bit, adds up to 0 with a carry for bit 3.

The column for bit 3 contains 1 and 1, plus the carried 1. According to Rule 4, the result is 1, with a carry for the next bit. ResultofaddingO, 1, and a carry at bit4is0, with a carry for bit 5.

BIT

BIT

7 6 5 4 3 2 1 0

I l I i l 1 0 0 1 1 0 1 1

+ 1 0 0 0 1 1 0 1

100101000

121110 9 8

1 1 0 1 + 1 1 0

1 0 1 0 0

(a)

(b)

7 6 5 4

1 0 1 1 1 0 0 0

0 0 1 1

AUGEND ADDEND

SUM

3 2 1 0

1 0 1 1 0 0 0 0

1 0 1 1

Bit 5 position has 0 as both augend and addend. Hence, the only count for this position is 1, the carry from bit 4. No carry is generated by adding the bit 5 digits, and the result is 1. With two 0 bits at position 6, and no carry, the bit 6 sum isO.

Bit 7 produces a 0 and a carry into the bit 8 position. Thus, the two originalS-bit values have produced a sum that requires 9 bits. An 8-bit value is called a byte. A carry that goes into the ninth position, as the final carry of Fig. 7(a) does, is referred to as a carry outside the byte. In 8-bit com­puters, such a carry requires special handling.

Another trick will help keep track of bit positions in large binary numbers. Bits may be grouped by fours- some­times called nibbles- with a space on either side to set them

c

Page 23: Introduction to umber ystems

)

-

off. Fig. 7(b) shows the addition of 12-bit and 11-bit values, with the bits grouped by fours for clarity. The same rules for binary addition still apply, and the same add-and-carry pro­cedures. Again, one more bit is generated in the answer than appears in either of the original values. Because of a carry outside the final nibble, the answer is a 13-bit value, occupy­ing bit positions 0 through 12.

lJ@ Binary Subtracting and Borrowing

Your experience with common decimal subtraction has no doubt given you enough background that binary subtraction should offer little challenge. However, these four rules for bi­nary subtraction will help:

1. 0-0 = 0

1-1=0

1-0=1

4. 0 - 1 = 1 with a borrow

Only large-number borrowing may give you some diffi­culty.

Exercise (a) in Fig. 8 shows simple binary subtraction. No borrowing is required, and each bit position can be sub­tracted using one of the first three rules listed above.

Exercise (b) generates one borrow, at bit 2. Go through the whole exercise: at bit 0, 1 minus 1 is 0. The same is true at bit 1. At bit 2, you can't subtract 1 from 0, so a borrow is nec­essary, from the minuend at bit position 3. This leaves the bit 3 minuend with a value of 0. The difference at bit 2 is 1, ac­cording to Rule 4. This derives from the fact that borrowing makes the value at position 2 binary 10. One decrement (count downward) from binary 10 leaves 1.

By the way, you did read that as "binary one-zero" (or "one-oh"), didn't you - rather than "ten"? You did? Excel­lent! Proceed.

With both minuend and subtrahend 0 at bit 3, the differ­ence is 0. (As always, the leading zero can be dropped in the answer.)

1 1 0 1 1 0 0

1 0 0 1

(a)

1 0 1 1 1 1 1

0 1 0 0

(b)

BIT 7 6 5 4 3 2 1 0

0 l I 1 0 0 '7 J& §3 ;J 1

1 1

I D 0 0 I I I 0 (c)

Fig. 8. About the only time binary subtraction will be confusing is when multiple borrows are involved. Still, if you form the habit of jotting down the borrow results above the minuend, you'll avoid inaccuracies caused by losing count.

19

Page 24: Introduction to umber ystems

20

Exercise (c) in Fig. 8 offers more of a challenge. Of course, bit 0 is easy: taking 1 from 1leaves 0. But bit 1 may slow you down a little. To subtract requires a borrow, since the minuend is zero and the subtrahend is 1. Unfortunately, the minuend at bit 2 is 0, too, so you can't borrow from it. And the same is true at bit 3.

So, use the distant-borrowing technique described in Art. 12 for decimal subtraction. The third rule for borrowing reads:

When you encounter a zero adjacent to the digit you must borrow for, borrow instead from the next more significant nonzero digit, decrementing its value by 1. Then, change all intervening zeroes to the highest digit value the number sys­temallows.

So, in Fig. 8(c), borrow from the bit 4 minuend. Decre­menting drops that digit to 0. The highest value in the number system is 1, so you must change the intervening zeroes- at bits 3 and 2- to 1. Now, with the borrow com­pleted, subtract the subtrahend 1 at bit 1 from the new minuend, 10. The result is 1, as the fourth rule for subtrac­tion indicates.

Proceed with regular binary subtraction. Each empty position in the subtrahend is, of course, equivalent to 0. Be sure to treat each minuend bit according to its value after the borrow.

Check your answer by adding it to the subtrahend, just the way you used to ''prove" your answers when you were learning subtraction in grade school. The result should be the original minuend.

1J@ One's and Two's Complement

Base-2 arithmetic includes some other bit manipulations. One such is called complementing. In binary parlance, the complement of any bit is the other bit value. Hence, the com­plement of 1 is 0, and the complement of 0 is 1.

An entire binary number can be complemented- that is, every bit in the number changed to the opposite bit value. The complement of binary 11 is 00; the complement of 101 is

Page 25: Introduction to umber ystems

' 010; the complement of 11110011 is 1100. (Remember to drop the leading zeroes.) Thus, the complement of 110 is 1 (actually 001). Fig. 9 illustrates further.

This bit-by-bit complement of a binary number is called its one's complement. This complement is actually created by adding 1 to each bit position, and dropping each carry that results. Hence the name.

Another useful complement of a binary number is its two's complement. You obtain this by finding the one's complement, and then adding 1 to it. Both (a) and (b) in Fig.lO start with values from Fig. 9. Mter finding the

one's complement, you add the value 1 to obtain the two's complement. As always, leading zeroes can be dropped.

Fig. 9. Taking a one's complement is a bit manipulation- an operation affecting each bit individually. Each bit in a one's complement is the inverse (opposite) of its counterpart in the source number.

Fig. 10. Taking a two's complement involves the same bit manipulation as one's complementing, followed by a summing operation- the addition of 1 to the new number.

21

Page 26: Introduction to umber ystems

Fig. 11. Two's-complement subtraction entails four steps. 1) (If necessary, first restore leading zeroes, to give the subtrahend the same number of digits as the minuend.) One's-complement the subtrahend. 2) Add 1 , producing the two's complement. 3) Add the minuend to the two's complement of the subtrahend. 4) Drop the excess carry, if there is.one, and cancel any leading zeroes that remain.

22

You can subtract binary values by finding the two's com­plement of the subtrahend and adding it to the minuend. Use regular bit addition, using all carries. Figs. 11 (a) and (b) in­clude two exercises in subtraction by this method. (Note that. one excess carry is usually generated, at the most significant end; it's always dropped.) Fig. ll(c) provides a proof of the work in (b); the difference and subtrahend must add up to the minuend.

~@Converting Binary to Decimal

You can convert numbers in any base to decimal values by using digit positions as exponents or powers. The base itself

Page 27: Introduction to umber ystems

is what you raise to the power. In base 2, for example, the de­cimal value ofbit 0 is equal to 2 raised to the 0 power. Thus, the position value of bit 0, in a binary value, is decimal!.

The decimal value for bit 1 of a binary value is 2 raised to the 1st power. So, the value ofbit 1 in any binary number is decimal2.

The decimal value for bit 2 of a binary number is 4, which is 2 raised to the 2nd power. The decimal value for bit 3 of a binary value is 8, which is 2 raised to its 3rd power. Table 2 shows how this relationship continues, through bit position 15. Any decimal equivalent value depends on the positions of the "active" bits in the binary number.

Conversion examples appear in Fig. 12. To convert to the decimal equivalent of a binary number, you first note

Fig. 12. Only nonzero digits matter in positional conversion. The positions of these "active" bits determine which powers of the base apply. The decimal equivalent is the sum of the applicable powers of the base.

23

Page 28: Introduction to umber ystems

24

which bit positions contain 1. (Those with 0 actually have no value: zero times any value is zero.) Jot down the decimal value for each 1, based on its position and the Powers of 2 chart in Table 2. Total these values; their sum is the decimal equivalent of the binary number.

~1] From Decimal to Binary

There are two methods of converting decimal values to bi­nary. One uses a kind of progressive subtraction; the other is known as modulo division.

In progressive subtraction, you use the Powers of 2 table. Follow these steps:

1. Find the largest power-of-2 value that can be sub­tracted from the decimal value to be converted. Its power of2 represents the position ofthe most signifi­cant bit in the binary value that will result. Put a 1 at that position.

Page 29: Introduction to umber ystems

2. Now subtract. The difference now becomes the next value from which a power-of-2 must be subtracted.

3. Repeat 1 and 2 until the decimal value is reduced to zero.

4. Enter a 0 in all bit positions where you didn't put a 1 during steps 1 through 3. Don't omit trailing zeroes.

Fig. 13 provides an example of this conversion tech­nique.

The decimal number to be converted to binary is 7370. The 12th power of 2, decimal4096, is the highest power that

DECIMAL TO BE CONVERTED 7 3 7 0 LARGEST POWER OF 2 (2'") -4096 ----

3 2 7 4 LARGEST POWER OF 2 (2") - 2 0 4 8

1 2 2 6 (2'0) .. 1 0 2 4

2 0 2 (2') - 1 2 8

7 4 (26) -- 6 4

1 0 (23) 8

2 (2') __ ---=...2_

0

BINARY PATTERN FORMED (BITS)

12 11 10 9 8 7 6 5 4 3 2 0

can be taken from 7370, so a 1 goes at bit 12. Subtracting 4096leaves 327 4. The 11th power of2 can be subtracted from that, so another 1 goes at bit 11.

Continuing these subtractions, the 10th power of 2 is less than 1226. The 9th and 8th powers of 2 are too large for 202, but the 7th power is okay. Then the 6th power of2 works for 74, the 3rd fits into 10, and, finally, the 1st can be taken from2.

As a result of these operations, you should have placed a binary 1 at bits 12, 11, 10, 7, 6, 3, and 1. You'd fill the other

Fig. 13. Progressive subtraction converts decimal values to binary. The highest power of 2 that can be subtracted from the source value indicates what bit number is most significant in the target value. Then, a 1 bit goes at each less significant position that corresponds to any power of 2 which can be subtracted from successive remainders. (Other positions are filled with Os.)

Page 30: Introduction to umber ystems

Fig. 14. You'll find modulo division easier for conversions, once you use it enough to become familiar with its concepts. Only remainders apply to the target value. Modulo 2 division, with a bit of practice, can be done "in your head."

26

bit positions- bits 9, 8, 5, 4, 2, and 0-with binary 0. And just like that, you've converted 7370 to 1110011001010, a 13-bit binary value! (If you question the accuracy of your work, you can convert the binary back to decimal by way of proof.)

G)) G)) Another Way to Get to Base 2 from e56Base10

In modulo division, you divide repeatedly by the base value, but save only the remainders. Fig.14 illustrates this method of calculation, converting a base-10 (decimal) value of2936 to base 2 (binary).

Here are the steps to follow:

1. Divide the decimal value by 2 (the base).

2. Write down the remainder. This is the least signifi­cant bit of the binary value you're after.

3. Divide the quotient thus derived by 2 again.

Page 31: Introduction to umber ystems

4. Again, write down the remainder. This is the next bit in the binary value.

5. Repeat 3 and 4 until the quotient equals zero.

In Fig. 14, the quotient for 2936 divided by 2 is 1468. Jot down the remainder, which equals 0. This becomes the least significant bit (bit 0) ofthe equivalent binary number. Write the quotient as the next value to be divided by 2. Continue until you run out of quotients.

Conversion from decimal to binary using modulo divi­sion is easy. Any decimal value that ends in an even digit leaves a 0 remainder, while a value ending with an odd digit forces a 1 remainder.

The final calculation -1 divided by 2-produces a quo­tient of zero and a remainder of 1. The final step always takes this form, and its result is always 1. The most significant bit would naturally be 1, since leading zeroes would have no meaning or value.

27

Page 32: Introduction to umber ystems

28

Binary-Coded Decimal (BCD) Numbers

~® Zero to Nine in Nibbles

Decimal values remain the most familiar numbers, espe­cially for measurements. But digital equipment and com~ puters can work only in a binary format. A bridge is therefore needed between the two.

One step in this direction involves a special kind of half­byte. As Table 3 verifies, a 4-bit number - binary 0000 through 1111 -expresses decimal values from 0 to 15. De­signers who had to deal in decimal numbers came up with the notion of using only 0000 through 1001, the equivalents of decimal 0 through 9. These bit patterns are called binary­coded decimal values- abbreviated BCD.

Each 4-bit pattern represents one decimal digit. To ex­press a two-digit decimal value with binary digits, you use two 4-bit BCD patterns. A four-digit decimal value takes four 4-bit BCD patterns.

A few minutes spent with the upper portion of Table 3 will fix these ten binary patterns firmly in your memory. They crop up regularly wherever digital instruments are used.

~~ Larger BCD Numbers

Table 4 shows that BCD notation doesn't save you anything in terms of fewer bits. But other advantages outweigh the size handicap of BCD values:

.1. BCD patterns are easily translated into decimal equivalents.

Page 33: Introduction to umber ystems

• 2. BCD patterns can represent analog values digital form.

3. BCD patterns, grouped in fours, are easy fo:r byte­oriented digital and computer systems to work with.

~@) BCD Mathematics

You'll find BCD values easier to add or subtract than ordi­nary binary numbers. Fig. 15 shows the direct way. Note that you don't deal with bits; instead, you treat each group of

Fig. 15. Four-bit binary groups in binary..;:xxied decimal (BCD) notation never exceed 1 001 - the equivalent of decimal 9. Hence, for any arithmetic, you can treat each "nibble" as one decimal digit

caution. BCD values can be easily confused with four-bit binary numbers. Therefore, before adding, subtracting, or converting, be sure you know which ones you're dealing with.

29

Page 34: Introduction to umber ystems

Fig. 16. Computers treat binary~ coded decimal {BCD) values as if they were ordinary base-2 numbers. However, answers to calculations are wrong until the arithmetic unit applies a decimal-adjust mask- a ·value added to any nibble that exceeds 1 00'1 after the calculations. This convefts binary results back to BCD.

30

adding tracting. Remember each 4-bit group represents one decimal digit. Figs. (b) make and carries don't operate in the usual

Electronic instruments and computers approach BCD operations a hit differently. You can emulate their though, if you know the trick.

First of all, they handle the 4~bit patterns as if they were regular binary values. That is, the BCD value 1001 example, goes into the arithmetic unit of a computer or ct:m­troller looking just like binary 10010110. To add the BCD value 0010 0111, the computer acts as it were adding nary 0010011L

The Binary Sum line of Fig. 16 shows the result of add­ing the two values by ordinary binary addition. A problem

immediately apparent: the binary sums obviously aren't BCD groups. Bits in both nibbles exceed the BCD maximum valueof1001.

However~ they can restored to accurate BCD sums. 'fo accomplish this, arithmetic unit of through an operation called decimal adjust (DA). First, it

least nibble of the answer. binary number the lOOllimit for metic unit adds 0110 (called a decimal-adjust mask) to the group. In the exercise of Fig. 16, this sums up to 0011, with a carry into the second nibble.

Page 35: Introduction to umber ystems

0 Next, the arithmetic unit repeats this procedure for the

most significant nibble. The masked or adjusted result is 0001, again with a carry. The carry from the first nibble must also be added, so the second nibble totals 0010. A carry from the second group creates a third nibble, with a value of 0001.

As you can see, decimal-adjust masking delivers an ac­curate answer in BCD notation. In the same manner, you can add or subtract BCD values as if they were binary val­ues. Merely adjust the result.

31

Page 36: Introduction to umber ystems

Check Your Learning 2

Time for another relaxing interlude. During your break, have a go at answering these questions on binary numbering. If you find them diffi­cult (or if any of your answers prove incorrect), review the articles re­ferred to. Remember, you're building a foundation to future studies, so don't skip any part you don't understand.

1. On the lines at right, write binary numbers for decimal values 0 through 15.

2. The two's complement for 10010 is A. 01101. c. 1110. B. 10011. D. 10001.

3. On the lines at right, list decimal values for these binary numbers. a. 100000 c. 10101 b. 111110 d. 1001 0010

4. BCD values are arranged in groups of A. two decimal digits. C. two binary bytes. B. four binary digits. D. eight bits.

5. A quick way to subtract binary-coded decimal values involves A. a decimal-adjust operation. B. positional notation. C. modulo 2 division. D. finding the one's complement and adding.

Answers to Check Your Learning 2

~ 'JJV ·uon -eJedo tsn[pe-rew!:>eP e ·~ ·s ~·w

re·w "9rv~:--_-:on. ~-,:-00~~00=-:-~ ·p

re ·JJV ~t - ~oto~ ·o re ·JJV ~9 - ou~u ·q re ·w ~ - ooooot ·e ·e

32

o~ ·Bt:1 ·s~ 'JJV on~ ·a ·~ 9 ·6!:1 ·s ~ ·w

~~~~·o~~~·~o~~·oo~~ ·uo~ ·o~o~ ·~oo~ ·ooo~ ·~~~o·o~~o·~o~o·oo~o I~ ~00 '0 ~00 1 ~000 '0000 • ~

Page 37: Introduction to umber ystems

Hexadecimal Numbering: Base 16

~@ From 0 to Fin Base 16

As you probably know by now, the distinction between number systems lies in the total number of digits available to count with. In decimal, there are ten; in binary, two. Hexadecimal numbering offers sixteen digits. To put it another way, hexadecimal numbers relate to the base 16.

Hexadecimal counting begins like decimal. That is, it goes 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ... and there you have to pause, right? Arabic digits stop at 9. But hexadecimal numbering draws from the alphabet for its last six digits -using A, B, C, D, E, and F after 9.

So, you actually count from 0 to Fin the base-16 num­bering system:

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

The equivalent decimal values for these alphabetic sym­bols are obvious:

A= 10 B=ll c = 12

D= 13 E = 14 F= 15

Those who work with hexadecimal soon grow accus­tomed to using letters as digits!

~{] Counting Higher in Hexadecimal

Base-16 counting follows the usual pattern. To clinch your understanding of the principles, though, here is a detailed description of the procedure:

33

Page 38: Introduction to umber ystems

34

1. Start with zero.

2. Increment one step at a time, until you reach the highest digit the base allows.

3. Increment once again. The least significant digit (LSD) reverts to zero and sends a carry of 1 to the next more significant digit, incrementing it.

4. Repeat 3 until both positions contain the highest digit value the base allows.

5. Increment again. This turns the LSD to zero and forces a carry, which turns the next significant digit to zero and forces another carry.

6. Continue adding a more significant digit whenever all current digits reach the highest value allowed.

Now, let's apply these principles to the hexadecimal number system (often called hex numbering). After reaching F, the highest single-digit value in base 16, the first digit re­verts to 0 and the second digit position increments to 1. After which, further counting increments the LSD again. A se­quence like the following is the result:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, lA, 1B, 1C, 1D, lE,

lF, and so on

Remember, you have to overcome the habit of calling that second row "ten, eleven, twelve, thirteen, .... " For one thing, those are decimal terms, while the digits above are hexadecimal. Worse, after you pass "nineteen," you've no equivalent decimal term to fall back on.

Use the terms "one-zero, one-one, one-two, one-three" and the like for hexadecimal values. If you do that, it's much easier to continue: " ... one-nine, one-ay, one-bee, one-cee, one-dee, one-eee, and one-eff." Moreover, in conversation, another engineer or technician will realize immediately that you're referring to hex numbers, rather than decimal.

Page 39: Introduction to umber ystems

As you need to count further in base 16, the patterns go: 20,21,22,23,24,25,26,27,28,29,2A,2B,2C,2D,2E,

2F

after reaching 9F:

AO, Al, A2, A3, A4, A5, A6, A7, A8, A9, AA, AB, AC, AD,AE,AF

and so on through EF to

FO,Fl,F2,F3,F4,F5,F6,F7,F8,F9,FA,FB,FC,FD, FE,FF

If the counting needs to go even higher, then:

100, 101, 102, 103, 104, 105, 106, 107, 108, 109, lOA, lOB,lOC,lOD,lOE,lOF,llO,lll,l12,113,114,115, 116, 117, 118, 119, llA, llB, llC, llD, llE, llF

and so on, through

FFl,FF2,FF3,FF4,FF5, FF6,FF7,FF8,FF9,FFA, FFB,FFC,FFD,FFE,FFF

after which comes 1000. Hexadecimal numbering plays a key part in all of your

future studies of digital elec~ronic and microprocessor sys­tems. If you have any doubts about your understanding of base-16 values and how they're formed, go through the counting exercises again, writing the values on scratch paper. Fill in the values that the examples above skipped. Soon, the pattern of hexadecimal counting will emerge, and you'll be on your way to using it as easily as you use decimal counting today. Or almost.

~® Binary to Base 16 by Nibbles

Why a base-16 number system? You know how difficult it is to read, recognize, decipher,

and use large binary numbers like 1101111101111010. I mean, where do you begin to tackle a number like that?

35

Page 40: Introduction to umber ystems

36

Breaking such a number into four-digit groups helps- a lit­tle. Digital circuits and computer devices have no trouble reading huge bit patterns, but electricians, technicians, and engineers need some more recognizable system of notation.

The base-16 number system fits this purpose neatly. Study the binary, hex, and decimal values in Tables 5 and 6.

Page 41: Introduction to umber ystems

0 Each half-byte, whatever its bit pattern, can be represented by a hexadecimal digit. And an entire byte requires only two hex digits.

The usefulness of this concept should be apparent: big, unwieldy values take on short, clearcut identities. For exam­ple, binary 01111010 looks a lot like 10111010. Only when they're next to each other do they appear distinctly separate in pattern. But their hexadecimal equivalents- BA and 7 A -are easy to distinguish and to remember.

Here are the two steps in the conversion from binary to hex:

1. Parse the binary value into groups of four bits.

2. Convert each bit group to its equivalent hexadecimal digit.

These rules will help you speed conversion from base 2 to base 16.

Converting in the other direction doesn't have to take a lot oftime, either. Steps in the conversion from hex to binary are:

1. Set down the 4-bit binary equivalent for each hexadecimal number.

2. For easier recognition, leave the binary value in 4-bit groups.

Using Tables 5 and 6, practice converting values be­tween binary and hexadecimal notation. You'll find it's easier than conversion between any other two number sys­tems!

~@ Base 10 to Hex by Modulo Division

Converting decimal values to hexadecimal (base 16) can be accomplished in either of two ways. And you studied both methods earlier.

You can use a Powers of16 table, and the successive sub­traction technique you learned for conversions to base 2. Table 7lists the powers of16.

37

Page 42: Introduction to umber ystems

Fig. 17. For converting decimal numbers to hexadecimal, modulo 16 division follows the same procedure you learned for modulo 2: dividing by the base, and keeping only remainders for the target value. (For hex, of course, you divide by the base 16.)

38

However, for large decimal values, modulo division works better. Fig. 17 shows an exercise in modulo division.

4 a R 0 A

2 $ 2 J i 1 $ 1 7 R 7 7

6 j 1 0 0

t 1 B

BtsSUU:

4 1 7 8 B 0 A

Finally, here is the procedure for converting decimal to hexadecimal:

1. Divide the decimal value by 16 (the base).

2. Write down the remainder, using a hexadecimal digit. (This value forms the least significant digit of the target hexadecimal value.)

3. Divide the quotient thus derived by 16.

4. Again, jot down the reminder. This is the next digit for the hex value.

5. Repeat steps 3 and 4 until the quotient equals zero.

The final remainder, expressed in hex notation, becomes the most significant digit of the converted hexadecimal value.

In Fig. 17, dividing 45178 by 16 gives a quotient of 2823 and remainder of10. The hex equivalent oflO is A, which be­comes the least significant digit of the hexadecimal value being found.

Dividing the quotient 2823 by 16 produces a new quo­tient of 176. The remainder is 7, which is also 7 in hexadeci­mal. This provides the second digit for the hex value.

Next, divide 176 by 16. The answer is 11, and there­mainder is 0, since 176 divides evenly by 16. The third digit in the hex value, therefore, is 0.

Page 43: Introduction to umber ystems

0 Dividing 11 by 16, you get a quotient of 0 -with 11 re~

maining, of course. Hexadecimal B is equivalent to decimal 11, so B is the most significant digit of the hexadecimal value. Conclusion: decimal 45178 converts to hexadecimal B07A.

~@ Recognizing Hexadecimal Data

Work your way now through the exercise in Fig. 18. For each remainder, you'll find that the hexadecimal digit is the same as the decimal digit. When you're through converting, you should have a hex value of 6792.

This introduces a problem in notation. When letter-type hex digits appear in a value, you recognize it immediately as a base-16 number: only hex uses the alphabetic digits A through F. But hexadecimal6792 looks exactly like decimal 6792.

a a In subscript notation, hexadecimal

6792 would be written 679216, meaning "to the base 16." Conversely, decimal6792 would be written 679210, meaning "to the base 10."

Subscript notation extends to binary values, too. Binary 112 (to the base 2) is easily distinguished from decimall110•

You can see at a glance that 11002 is not the same as 110010

or110016•

Fig. 18. Sometimes, you can't distinguish between decimal numbers and those of other bases: their numeric digits look exactly alike. Consequently, a value like this result of a modulo conversion needs a base classifier. Subscripts are favorites of mathematicians; programmers often use a $ prefix for hex values; others, finally, often fall back on the H suffix.

Page 44: Introduction to umber ystems

40

Some writers append the letter H to every decimal value. You'd recognize B07 AH and 6792H both as hex val­ues. (Decimal values take no suffix.)

Computer programmers use symbols to indicate the base of a value. Sometimes, the exact symbol and its usage depend on what hardware the program is to run on. A com­mon symbol for hexadecimal, though, is the prefixed dollar sign ($), as in $B07 A. Binary values are sometimes prefixed with a percent symbol, as %1100. This convention, too, leaves decimal values without an identifier.

This and future lessons employ both subscript and program-symbol notation. For the most part, the choice de­pends upon the context in which the values appear. In gen­eral, though, subscripts are best suited to mathematical usage and symbols apply best to programming.

®lJ Hex to Decimal by Position

Position values offer a quick way to convert numbers in any base to their decimal equivalents. Base 16 numbers require the use of the Powers of 16 chart in Table 7.

Page 45: Introduction to umber ystems

0 Digit positions in any are numbered the way

bitE~ are. That is, the least significant digit is digit 0. Next comes digit 1, then digit 2, and so on. For conversions, digit numbers correspond with exponents in a Powers of the Base chart.

As an example, consider the hexadecimal value A3. To convert it to decimal, you'd consult the Powers of 16 table (Table 7). Digit 0 is 3, and the decimal value of its position corresponds to 16°. Since 16° = 1, hex 3 in the digit 0 position equals decimalS (digit value time$ position value). The next hex digit, A, is in the digit 1 position. Its position value cor­responds to 161, which is 16. Multiply the decimal equivalent of A (10) by the position value (16). A in this hex position is worth decimal160. Totaling the equivalent values of A and 3, you find that hex A3 is equal to decimal163.

This conversion principle applies to large hex numbers, too. An example appears in Fig. 19. Digit 0, with a position value of 1 and a hex digit value of A, nets a decimal value of 10. Digit 1, with a position value of 16 and a digit value of 2, nets 32. Digit 2, with a position value of256 (162) and a digit value of9, adds a net decimal value of2304. Digit 3, finally, with a position value of 4096 (163) and a digit value ofB (or decimalll), nets 45056. Totaling, you find that the decimal equivalent ofB92A is 4 7 402.

~~ Hex Arithmetic the Easy Way

Adding and subtracting base-16 numbers may seem compli­cated at first. However, you've got three methods to choose from.

Fig. 19. Conversion by position value assigns a weight to each position, equal to the base taken to a power corresponding to that position. This is why the exponents of 16 are the same as the digit position numbers. The digit value in the original number serves as a muiltiplier, in each instance. The total decimal value is a sum of the net values found at all positions.

41

Page 46: Introduction to umber ystems

DIGIT 3 2 1 0 I I

B 0 6 A + 2 E B 7

D F 2 I

Fig. 20. Continue the practice of writing down carries, even in simple hexadecimal addition, until you're completely familiar with the number system.

A F !6 BR!RfA

- 2 E B 7

8 I B 3 (a)

J I 2 E B 7

+ 8 1 B 3

BZbA (b)

Fig. 21. Borrowing in hexadecimal subtraction follows the same rules as in any other number system. Writing the results of each borrow above the minuend helps to avoid miscalculations.

42

Some technicians convert to another number base, do the math, and then convert back. Or then there's Base 2, which offers easy conversion but unfamiliar arithmetic. Fi­nally, base-10 math is well-known, usually, but conversion from and to base 16 takes time.

Working directly in hex poses no serious obstacle. Car­ries and borrows present only minor stumbling blocks. If you take the counting approach, and confine yourself to no more than two numbers at a time, you may well discover yourself doing base-16 arithmetic without a hitch.

A sample exercise appears in Fig. 20. The assignment is to add 2EB7 to B06A. Start with digit 0. From A (in hex), in­crement 7 times. (Use your fingers, if it helps.) The count goes B, C, D, E, F, 10, 11. Digit 0 of the sum, therefore, is 1, with a 1 carry to the digit 1 column.

For digit 1, increment 6 times from B. The count is C, D, E, F, 10, 11. To this, add another count for the 1 carry from digit 0, bringing the total to 12. So, digit 1 of the sum is 2, and a carry of 1 goes to the digit 2 column.

For digit 2, increment from E. Once is enough, since the only count added toE is a carry from the digit 1 position. F is the sum in this column.

For digit 3, two increments up from B brings you to D. Hence, the sum ofB06A and 2EB7 is DF21. Using this count­ing method at each digit position brings base 16 under con­trol, despite its relative unfamiliarity.

~~ Base-16 Subtraction and Proof

Base-16 subtraction goes much the same way; procedures are the same as for any number system. Try the exercise in Fig. 21(a), subtracting 2EB7 from B06A. Again, use your fingers if you want to.

You can look at subtraction in column 0 as taking 7 away from A, or as counting from 7 to A. The first way leaves 3; with the second way, a count of 3 takes you from 7 to A. Either way, the difference at digit 0 is 3.

Digit 1 offers a tougher combination: you can't subtract a larger subtrahend from a smaller minuend. So remember the third rule ofborrowing:

Page 47: Introduction to umber ystems

0 When you encounter a zero adjacent to the digit

you must borrow for, borrow instead from the next more sig­nificant nonzero digit, decrementing its value by 1. Then change all intervening zeroes to the highest digit value the number system allows.

In Fig. 21(a), you borrow from digit 3 of the minuend, reduc­ing the B to A. The intervening 0 becomes F - the highest single-digit value base 16 allows.

Any base-16 borrow accounts to 10 counts (hex); so the value of the 6 at digit 1 in the minuend becomes hex 16. Counting between B and 16 is easier than trying to compute differences. A count goes C, D, E, F, 10, 11, 12, 13, 14, 15, 16. How many counts did that take? It took B counts. Con­sequently, subtracting B from 16leaves B. (Remember, 16 is one-six, not sixteen- hex, not decimal.)

The rest is easy. E from F is 1. (There's only 1 count be­tween the two.) And 2 from A is 8. Thus, subtracting 2EB7 from B06A produces a difference of81B3.

You can prove your work by adding the difference and subtrahend, as has been done in Fig. 21(b). At digit 0, hex 7 plus hex 3 equals hex A. Digit 1, however, may not seem quite as easy: B plus B equals 16. But how to arrive there, if you haven't memorized hex sums? Try counting from B: C, D, E, F, 10, 11, 12, 13, 14, 15, 16 ... stopping when you've reached B counts. If keeping track seems difficult, use your fingers. (B is eleven fingers.) Put down the 6 for digit 1 of the sum, and carry the 1.

E plus 1 equals F, plus the carried 1 equals 10. Put down the 0 and carry the 1. Hex 8 plus 2 equals A. Add the carried 1, making the last digit B.

If your proof answer in (b) equals the minuend in (a),

both calculations are correct. No need for bulky conversion!

43

Page 48: Introduction to umber ystems

44

Octal Numbering: BaseS

®~ Counting in Octal

A number system in base 8, o:r octal, uses eight digits. Arabic numerals are fine: octal numbering requires only those from 0 to 7.

As you may guess, counting tops out at 7, with the digit reverting to 0 as a ca:rry moves to the next digit position. Hence:

0, 1, 2, 3, 4, 5, 6, 7

and then

10,11,12,13,14,15,16,17

and soon. If the count reaches 77, the next value is 100. When the

count reaches 177, the next count is 200. As with other non­decimal numbers, it helps clarify the value if you say "one­seven-seven, two-zero-zero," and the like. When a count reaches 777, the next increment makes it 1000. After 7777 comes 10000, and so on. The concept is the same as in other number systems.

You can also use subscripts to identify octal values. Thus, you'd read 377 8 as "three-seven-seven to the base 8." This tells you that the value is octal.

The letter 0 at the end of an octal value sets it apart from decimal, hex, and binary. Octallll might appear as

Page 49: Introduction to umber ystems

1110. In the programming context, you'll find octal values with an "at" symbol(@) as a prefix. In that mode, octallll would be written @ 111.

~@ Binary Triads Equal Base 8

Take a look at the binary number 01111010 in Fig. 22. You'll note that this 8-bit value has been partitioned into groups of three bits each.

Consider the rightmost group first: its decimal value is 2. (Remember, however, that 2 is also an octal digit.) Three bits in the center group, all set to 1, represent 7, the highest possible octal value. For the leftmost group, only 2 bits of the byte remain. Decimal value: 1. Octal value: also 1.

Grouping bits by threes lets you convert any bi~ nary number to its octal equivalent. To convert back, just write each octal digit as a 3-bit binary value. Thus, octal 377 converts to binary 11111111. You can see the relationship more easily if you leave the bits grouped as follows: 11 111 111.

~@ Octal to Hex via Base 2

Both base-8 and base-16 notation are popular for denoting digital controller and computer bytes. For one thing, conver­sion between either one and base 2 is simple and quick. It takes only a little practice to become adept. You'll find base 2 a fast route between octal and hexadecimal.

An example: Binary instructions for an 8080 micropro­cessor are coded in 3-bit groups. Instructions must fit an 8-bit format, so the bits are grouped two-three-three. These are one-byte instructions.

Today, most programs and utilities display instructions and data in hexadecimal form. You might need to convert hex information to octal in order to recognize a particular 8080 instruction; or, you might have to convert an octal in­struction to hex, in order to place it correctly among other hex data.

Fig. 22. Octal numbers can be derived from binary by the simple expedient of grouping the bits into threes. Note that the most significant (leftmost) group has only two bits, since the octal source value is a byte (eight bits).

45

Page 50: Introduction to umber ystems

Fig. 23. You can figure out the hex version of byte-size octal codes or data by regrouping bits as shown. Remember, though, this is only for your own convenience in interpreting values. A computer or programmable controller uses the bit pattern of the byte without regard for any such "grouping.•

46

Conversion back and forth is easy because of the com­mon digital (base-2) origin. One such binary operation code, shown in Fig. 23, tells the SOSO microprocessor to perform a simple arithmetic operation. You might use it in octal for programming a machine. That's easy: 07 4 is the op code. Later, you might find the hex value 3C in a display of codes, and wonder what its purpose is. Quick conversion would tell you that 3C is the same SOSO instruction code as 07 4.

'liJ?J Octal to Base 10 and Back

You use position value for converting base-S values to deci­mal. To do so, you need the Powers of S chart in Table 8.

Consider the octal value 167. Digit 0, the 7, has a posi­tion value of 1 (S0). Net decimal value of the digit 0 position, then, is 7.

The position value of digit 1 isS (S1), and the digit there is 6. Consequently, net decimal value amounts to 48. Posi­tion value of digit 2 is 64 (S2). With a digit value of 1, the net value of this position is 64.

Total the net values. A sum ofl19 is the decimal value of octal167, found by the position-value method.

To convert decimal in octal, use modulo S division. Fig. 24(a) illustrates. A decimal value of 4716S divided by 8 yields 5S96 and a 0 remainder. This 0 becomes the least sig­nificant digit of the octal number being found. 5S96 divided by Sis 737, and again there's no remainder. But the 0 must be noted; it will be needed in the octal value.

Dividing 737 by S yields 92, with a remainder of 1. Di­viding 92 by S finds 11 and a remainder of 4. Dividing 11 by S yields 1 and a remainder of3. Finally, dividing 1 by S yields 0 and a remainder of1. Hence, the decimal value 4 7168 has an octal equivalent of134100.

Page 51: Introduction to umber ystems

Let's carry this exercise a few steps further, the way Fig. 24(b) does. Convert 134100 to a binary value by mark­ing down the three bits that represent each octal digit. You'll end up with the value (grouped for octal) 001011100 001 000 000.

Beginning with the least significant bit, rearrange the binary value into half-byte groupings - that is, four bits each- and convert to hexadecimal. Thus, the decimal value that corresponds to 134100 octal is also equivalent to B840 hex. This demonstrates again the close relationship among the base-2, base-8, and base-16 number systems.

®@ Octal Arithmetic

In adding octal numbers, you duplicate the procedures you've learned for the other number systems. To help clinch it for you, take a look at the three exercises in Fig. 25. One demonstrates addition, two subtraction.

The counting approach works well. In (a), the first count is: 7, 10, 11 (pronounced seven, one-zero, one-one, remember) -that is, three counts upward from 6. Write 1 in the answer, and carry 1. Next, a count of 1 (the carry) upward from 7 is

Fig. 24. Modulo 8 division converts a decimal number to octal, using remainders only. You'll find a useful correspondence between base-16, base·8, and base-2 number systems. As already demonstrated, binary notation forms a handy bridge between octal and hexadecimal.

I J 2 7 3

+ 1 0 6 _____ ,_

·4 (a)

{;; 2 f/

1 0 6 ----b

(b)

DIGIT 4 3 2 1 0

7 2 3 4

(c)

Fig. 25. The hardest part of octal arithmetic is remembering that 10 comes after 7. However, a little practice with octal numbers will resolve that unfamiliarity. In any case, working with digital and computer electronics you'll seldom need to compute octal values.

47

Page 52: Introduction to umber ystems

48

10. Write 0 in the answer, and carry 1. Finally, 2 and 1 and 1 are 4. Write it in the answer. The total is 401 octal (that's four-zero-one- not four hundred one).

In (b), you face a borrow immediately. Borrowing from the 7 leaves that digit value at 6. Minuend value 3 becomes 13 (one-three). The count from 6 to 13 is 5. (Try it: 7, 10, 11, 12, 13.) Write 5 as the answer at digit 0.

Next, 0 from 6 (remember, the 7 was borrowed from) leaves 6. Write 6 as the answer at digit 1. In the MSD posi­tion, 1 from 2 is 1. So, the complete answer is 165 octal.

At (c), repeated borrowing presents something of a chal­lenge. If you've forgotten the third rule of borrowing, better review it again (Page 12).

You have to go all the way to digit 2 of the minuend to borrow from the 1 there. The borrow raises the 0 at minuend digit 0 to 10 octal. An intervening 0 - at digit 1 of the minuend- must be changed to 7. Now you're ready to sub­tract. The count between 4 octal and 10 octal is 5, 6, 7, 10-four counts. Write 4 as digit 0 of the answer.

At digit 1, taking 3 from 7 leaves 4. Write this value for the answer at digit 1. You must borrow again for digit 2. This time you can borrow from the adjacent digit, decrementing -its value of 4 to 3. The 0 at digit 2 of the minuend therefore becomes 10. The count between 2 and 10 is 3, 4, 5, 6, 7, 10-six counts. Write 6 as the answer there.

Borrow again, decrementing the 3 value at digit 4 to a value of 2. (The 3 at digit 3 in the minuend beco~es 13, of course.) From 7 to 13, the count is 4, which is the answer for digit 3.

Finally, an implied 0 in the subtrahend, taken from 2 in the minuend, leaves 2 as the answer at digit 4. Taking all di­gits together, the answer is 24644 octal. If you've got any doubts, prove your answer by adding the difference to the subtrahend. They should equal the minuend.

~@ Split-Octal Concept

Computers and electronic controllers often deal in two-byte binary instructions and data. Hexadecimal notation handles binary values ofthis size neatly. you see a 4~(n~n hex C07F t you know that 16 bits are because each hex digit represents 4 bits. In hex, CO and

Page 53: Introduction to umber ystems

0 7F each name a one-byte value; their bit patterns are 1100 0000 and 0111 1111, respectively. Written together, as C07F, they form a two-byte (or 16-bit) value. Annexed this way, their bit pattern is 1100 0000 0111 1111. As you can see, nothing in their bit arrangement has changed.

You can't combine byte values so easily in base 8; in fact, octal notation is best confined to one-byte values. Fig. 26 demonstrates why. Consider the octal value 377 in (a). Con­verted to binary digits or bits, this value appears as 11 111 111. It has eight bits, and thus comprises a one-byte value. The decimal equivalent, converted from either version, is 255.

Take a look at another value, 203 octal. Its bit pattern is 10 000 011, and its decimal value is 131. However, this new one-byte value, expressed in octal, can't be annexed directly to the first one-byte octal value.

You can see what would happen, at (b) in Fig. 26. The bi­nary values have been connected to form a 16-bit pattern. You can do this with any pair of byte-size binary values. The decimal equivalent of this two-byte number is 65411.

Then the two octal values have been joined. The combi­nation no longer works in octal notation. The decimal equi­valent of377203 octal is 130691- a far cry from 65411!

However, two-byte octal values can be written in a man­ner called split-octal. This notation has only one purpose: to show two-byte octal values. You place a hyphen between the two octal values, as in the bottom version in Fig. 26. The bytes 377 and 203 octal become 377-203 octal.

Fig. 26. You can't show two-byte binary values with octal digits. However, octal may prove expedient when microprocessor codes are octal. If you have to use octal, you can show two-byte numbers (such as memory addresses) by the split· octal technique: a hyphen separates the two bytes, each of which is formed of usual octal digits.

49

Page 54: Introduction to umber ystems

50

In forming their binary equivalent, note that the most significant octal digit of each byte generates only two bits, just as it would if the bytes were alone. Now the decimal value of377 -203 octal- converted properly by way ofbase 2 -is 65411.

Three octal digits are used for each byte of a split-octal value, even if all three digits are zeroes, as in the value 377-000. The binary for this number is 1111111100 000 000 or 1111111100000000, for a decimal value of65280.

You can't add and subtract split-octal values easily. However, you can convert them quickly to binary, and figure other values from there - either decimal or hex. Just re­member to use only two binary digits for the MSD of each octal value.

Page 55: Introduction to umber ystems

0 Check Your Learning 3

Here's a final chance to assess your understanding of this lesson. An­swer the following questions on hexadecimal and octal numbering be­fore you go on to the Self-Test examination. Any wrong answers you give are a signal to restudy the indicated articles. (It may help to review earlier sections, too.)

1. To convert decimal numbers to any other number base, use A. hex inversion. C. modulo division. B. position notation. D. progressive subtraction.

2. On the lines at right, give the hexadecimal equivalents of these val-ues: A. 1111000000111100 C. 1135H B. 2378 D. 237

In the space in front of each expression on the right, write the letter of the number on the left which properly identifies it.

3. a. 126-077 b. 7E99 c. 1102 d. 378

e. 1101

4. Complete the following hexadecimal calculations: a. 9A27 + 31A9 = b. 9A27 - 31A9 =

5. You'll use split-octal notation for A. single-byte computer numbers. B. two-byte computer numbers. C. simplifying conversion from octal to decimal. D. converting between octal and hex.

Please tum page for Answers to Check Your learning

':,' ~ ~ ' ' '

' ',,' ,'

',, \'\' '

51

Page 56: Introduction to umber ystems

to 3

1. C. modulo division. Art. 29

2. A. F03C Art. 28 B. 9F Art. 36 c. 1135 Art. 30 D. ED Art. 29

3. _e_ Binary Art. 28 JL Octal Art. 34 _a_ Split-octal Art. 39 _a_ Decimal Art. 31 _b_ Hexadecimal

Art. 30 4. a. CBDO. Art. 32

b. 687E. Art. 33 5. B. two-byte computer num-

bers. Art. 39

52

Page 57: Introduction to umber ystems

0 Self· st

Read each of the following statements carefully and be sure you understand each one. Each statement is followed by four words or phrases, only one of which is correct. Draw an X through the letter that Indicates your answer.

1. The base of a number system refers to

A. how many different digits the system uses. B. how many digits are required to represent one byte. C. the highest value the system can represent. D. the highest one-digit value in the system.

2. The position of a digit in a number determines

A. the value of the digit. B. the base of the number system. C. a multiplier to obtain the net value of the digit. D. a decrement value for the number system.

3. In all the number bases you learned about in this lesson, addition involves

A. modulo division. C. decrementing. B. incrementing. D. a two's complement.

4. The next decimal value after 377-377 octal is

A. 65535. B. 65536.

c. 32767. D. 32768.

5. According to the third rule of borrowing, what happens to any zeroes intervening in the minuend between the digit borrowed from and the digit borrowed for?

A. Each zero is decremented. B. Each zero is incremented. C. Each zero is removed. D. Each zero is raised to the highest digit value.

6. In which of the following groups are all values equivalent to decimal 32760?

A. FF78, 37206, and 0101 011101110110 B. 7FF8, 077-770, and 0011111111111100 C. 8FF7, 7777, 017-776, and 11111111111100 D. 7FF8, 77770, 177-370, and 111111111111000

53

Page 58: Introduction to umber ystems

54

1. The BCD value 0001 1001 1000 0010 corresponds to what hex equivalent?

A. 1982H C. OEB7H B. 07BEH D. 2891 H

8. The next hex value after BCD value 0100 0000 1001 01 01 is

A. 1FFF. B. FFF1.

c. 1000. D. FOOO.

9. Grouping bits by four- each group called a half-byte or nibble- is useful for

A. finding hex values from binary numbers. B. finding octal values from binary numbers. C. finding decimal values from binary numbers. D. determining split-octal values.

10. The powers of 16 that are missing in the table are

Table of Powers of 16 for Hexadecimal-Decimal Conversions

Position in Hexadecimal

Number

A. 4and8.

1 2

3 4

5 6

B. 4096 and 65536.

Exponent of 16 Value

16" 16'

1 16

65536 1048 576

C. 256 and 4096. D. 255 and 4095.

Please tum the page for the self-test answers.

Page 59: Introduction to umber ystems

NOTES

-

Page 60: Introduction to umber ystems

1(. Solution

10.

Table of Powers of 16 for Hexadecimal-Decimal Conversions

Position in Hexadecimal Exponent of 16 Value

Number

1 16° 1 2 161 16

3 162 256 4 163 4096

5 164 65536 6 165 1048 576

56