Lab Activity 2

34 views
Skip to first unread message

Jeanette Vale

unread,
Jul 7, 2012, 5:38:08 AM7/7/12
to ccm111_20...@googlegroups.com

Name:

Section:

 

1. Binary Number System

2. Decimal Number System

3. Octal Number System

4. Hexadecimal Number System

Ranier Cordero

unread,
Jul 7, 2012, 5:50:48 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:Ranier G. Cordero

Section:HN3

 

1. Binary Number System

A Binary Number is made up of only 0s and 1s. The binary numeral system, or base-2 number system, represents numeric values using two symbols: 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2. Because of its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by almost all modern computers.

 

2. Decimal Number System

The decimal numeral system (also called base ten or occasionally denary) has ten as its base. It is the numerical base most widely used by modern civilizations.

Decimal notation often refers to a base-10 positional notation such as the Hindu-Arabic numeral system; however, it can also be used more generally to refer to non-positional systems such as Roman or Chinese numerals which are also based on powers of ten.

Decimals also refer to decimal fractions, either separately or in contrast to vulgar fractions. In this context, a decimal is a tenth part, and decimals become a series of nested tenths. There was a notation in use like 'tenth-metre', meaning the tenth decimal of the metre, currently an Angstrom. The contrast here is between decimals and vulgar fractions, and decimal divisions and other divisions of measures, like the inch. It is possible to follow a decimal expansion with a vulgar fraction; this is done with the recent divisions of the troy ounce, which has three places of decimals, followed by a trinary place.


 

3. Octal Number System

The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right). For example, the binary representation for decimal 74 is 1001010, which can be grouped into (00)1 001 010 – so the octal representation is 112.

In decimal systems each decimal place is a base of 10. For example:

\mathbf{74}_{10} = \mathbf{7} \times 10^1 + \mathbf{4} \times  10^0

In octal numerals each place is a power with base 8. For example:

\mathbf{112}_8 = \mathbf{1} \times  8^2 + \mathbf{1} \times  8^1 + \mathbf{2} \times  8^0

By performing the calculation above in the familiar decimal system we see why 112 in octal is equal to 64+8+2 = 74 in decimal.

Octal is sometimes used in computing instead of hexadecimal.



 

4. Hexadecimal Number System

 

In mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F (or alternatively af) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10995.

Each hexadecimal digit represents four binary digits (bits), and the primary use of hexadecimal notation is a human-friendly representation of binary-coded values in computing and digital electronics. One hexadecimal digit represents a nibble, which is half of an octet (8 bits). For example, byte values can range from 0 to 255 (decimal), but may be more conveniently represented as two hexadecimal digits in the range 00 to FF. Hexadecimal is also commonly used to represent computer memory addresses.


rey.mesajon

unread,
Jul 7, 2012, 5:51:41 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name: REY VINCENT MESAJON

Section: HN3

 

1. Binary Number System


To understand binary numbers, begin by recalling elementary school math. When we first learned about numbers, we were taught that, in the decimal system, things are organized into columns:

    H | T | O
    1 | 9 | 3
such that "H" is the hundreds column, "T" is the tens column, and "O" is the ones column. So the number "193" is 1-hundreds plus 9-tens plus 3-ones.

Years later, we learned that the ones column meant 10^0, the tens column meant 10^1, the hundreds column 10^2 and so on, such that

      10^2|10^1|10^0
        1 |  9 |  3 
the number 193 is really {(1*10^2)+(9*10^1)+(3*10^0)}.

As you know, the decimal system uses the digits 0-9 to represent numbers. If we wanted to put a larger number in column 10^n (e.g., 10), we would have to multiply 10*10^n, which would give 10^(n+1), and be carried a column to the left. For example, putting ten in the 10^0 column is impossible, so we put a 1 in the 10^1 column, and a 0 in the 10^0 column, thus using two columns. Twelve would be 12*10^0, or 10^0(10+2), or 10^1+2*10^0, which also uses an additional column to the left (12).

The binary system works under the exact same principles as the decimal system, only it operates in base 2 rather than base 10. In other words, instead of columns being

 
       10^2|10^1|10^0
they are
        2^2|2^1|2^0

Instead of using the digits 0-9, we only use 0-1 (again, if we used anything larger it would be like multiplying 2*2^n and getting 2^n+1, which would not fit in the 2^n column. Therefore, it would shift you one column to the left. For example, "3" in binary cannot be put into one column. The first column we fill is the right-most column, which is 2^0, or 1. Since 3>1, we need to use an extra column to the left, and indicate it as "11" in binary (1*2^1) + (1*2^0).

Examples: What would the binary number 1011 be in decimal notation?



Click here to see the answer

Try converting these numbers from binary to decimal:

Remember:
      2^4| 2^3| 2^2| 2^1| 2^0
         |    |    |  1  |  0
         |    | 1  |  1  |  1
      1  | 0  | 1  |  0  |  1
      1  | 1  | 1  |  1  |  0



 

2. Decimal Number System

Probably the biggest stumbling block most beginning programmers encounter when attempting to learn assembly language is the common use of the binary and hexadecimal numbering systems. Understanding these numbering systems is important because their use simplifies other complex topics including boolean algebra and logic design, signed numeric representation, character codes, and packed data.

This section discusses several important concepts including the binary, decimal, and hexadecimal numbering systems, binary data organization (into bits, nibbles, bytes, words, and double words), signed and unsigned number systems, arithmetic, logical, shift, and rotate operations on binary values, bit fields and packed BCD (Binary Coded Decimal) data, and the ASCII (American Standard Code for Information Interchange) character set. This is basic material and the remainder of this tutorial depends upon your understanding of these concepts. If you are already familiar with these terms from other courses or study, you should at least skim this material before proceeding to the next chapter. If you are unfamiliar with this material, or only vaguely familiar with it, you should study it carefully before proceeding. All of the material in this chapter is important! Do not skip over any material.

Most modern computer systems do not represent numeric values using the decimal system. Instead, they typically use a binary or two's complement numbering system. To understand the limitations of computer arithmetic, you must understand how computers represent numbers.

Remember how mathematical operations are entered into a computer:

+ is used for addition
- is used for subtraction
* is used for multiplication
/ is used for division
^ is used to raise to a power

You have been using the decimal (base 10) numbering system for so long that you often take it for granted. When you see a number like "123", you don't think about the value 123. Instead, you generate a mental image of how many items this value represents. In reality, however, the number 123 represents:

1 * 10^2 + 2 * 10^1 + 3 * 10^0 =

1 * 100 + 2 * 10 + 3 * 1 =

100 + 20 + 3 =

123

Each digit appearing to the left of the decimal point represents a value between zero and nine times power of ten represented by its position in the number. Digits appearing to the right of the decimal point represent a value between zero and nine times an increasing negative power of ten. For example, the value 725.194 is represented as follows:

7 * 10^2 + 2 * 10^1 + 5 * 10^0 + 1 * 10^-1 + 9 * 10^-2 + 4 * 10^-3 =

7 * 100 + 2 * 10 + 5 * 1 + 1 * 0.1 + 9 * 0.01 + 4 * 0.001 =

700 + 20 + 5 + 0.1 + 0.09 + 0.004 =

725.194



 

3. Octal Number System

Octal Number System (Base-8)
The octal number system uses EIGHT values to represent numbers. The values are,
                                                    0 1 2 3 4 5 6 7
  with 0 having the least value and seven having the greatest value. Columns are used in the same way as in the decimal system, in that the left most column is used to represent the greatest value.  As we have seen in the decimal system, the values in the set (0 and 1) repeat, in both the vertical and horizontal directions.
                                        0 - 7, 10 -17, 20 - 27, 30 - 37 ......

Example Convert 176 in octal to decimal.

Each column represents a power of 8,
264 becomes .....
                    4 * 80 = 4
                    6 * 81 = 48
                    2 * 82 = 128
adding the results together gives 180 (in decimal)


   Octal was used extensively in early mainframe computer systems, but has become less popular in favour of binary and hexadecimal today.
 

4. Hexadecimal Number System

A big problem with the binary system is verbosity. To represent the value 202 requires eight binary digits.

The decimal version requires only three decimal digits and, thus, represents numbers much more compactly than does the binary numbering system. This fact was not lost on the engineers who designed binary computer systems.

When dealing with large values, binary numbers quickly become too unwieldy. The hexadecimal (base 16) numbering system solves these problems. Hexadecimal numbers offer the two features:

  • hex numbers are very compact
  • it is easy to convert from hex to binary and binary to hex.

The Hexadecimal system is based on the binary system using a Nibble or 4-bit boundary. In Assembly Language programming, most assemblers require the first digit of a hexadecimal number to be 0, and place an "h" at the end of the number to denote the number base.  In PICBASIC, we simply put a "$" at the left end of the number.

The Hexadecimal Number System:

  • uses base 16
  • includes only the digits 0 through 9 and the letters A, B, C, D, E, and F

In the Hexadecimal number system, the hex values greater than 9 carry the following decimal value:

Binary Decimal Hex
%0000 0 $0
%0001 1 $1
%0010 2 $2
%0011 3 $3
%0100 4 $4
%0101 5 $5
%0110 6 $6
%0111 7 $7
%1000 8 $8
%1001 9 $9
%1010 10 $A
%1011 11 $B
%1100 12 $C
%1101 13 $D
%1110 14 $E
%1111 15 $F

This table provides all the information you'll ever need to convert from one number base into any other number base for the decimal values from 0 to 16.

To convert a hexadecimal number into a binary number, simply break the binary number into 4-bit groups beginning with the LSB and substitute the corresponding four bits in binary for each hexadecimal digit in the number.

For example, to convert $ABCD into a binary value, simply convert each hexadecimal digit according to the table above. The binary equivalent is:

$ABCD = 1010 1011 1100 1101

To convert a binary number into hexadecimal format is almost as easy. The first step is to pad the binary number with leading zeros to make sure that the the binary number contains multiples of four bits. For example, given the binary number 1011001010, the first step would be to add two bits in the MSB position so that it contains 12 bits. The revised binary value is 001011001010.

The next step is to separate the binary value into groups of four bits, e.g., 0010 1100 1010. Finally, look up these binary values in the table above and substitute the appropriate hexadecimal digits, e.g., %0010=$2, %1100=$C, %1010=$A.  %001011001010=$2CA.

The weighted values for each position is as follows:

163 162 161 160
4096 256 16 1

 
 
 

tayabasapriljohn

unread,
Jul 7, 2012, 5:55:08 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:April John Tayabas 

Section:HA3

 

1. Binary Number System

The binary numeral system, or base-2 number system, represents numeric values using two symbols: 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2. Because of its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by almost all modern computers.
 

2. Decimal Number System

Most commonly used number system, to the base ten. Decimal numbers do not necessarily contain a decimal point; 563, 5.63, and -563 are all decimal numbers. Other systems are mainly used in computing and include the binary number system, octal number system, and hexadecimal number system.

The decimals 0.3, 0.51, and 0.023 can be expressed as the decimal fractions 3/10, 51/100, and 23/1,000. They are all terminating decimals. These fractions can equally be expressed as the percentages 30%, 51%, and 2.3%.

Decimal numbers may be thought of as written under column headings based on the number 10.



Using the table, 567 stands for 5 hundreds, 6 tens, and 7 units; 28.02 stands for 2 tens, 8 units, and 2 hundredths.

567 has no numbers after the decimal point, that is 0 decimal places. 28.02 has 2 numbers after the decimal point, that is 2 decimal places.

 

3. Octal Number System

Octal Number System (Base-8)

The octal number system uses EIGHT values to represent numbers. The values are,
                                                    0 1 2 3 4 5 6 7
  with 0 having the least value and seven having the greatest value. Columns are used in the same way as in the decimal system, in that the left most column is used to represent the greatest value.  As we have seen in the decimal system, the values in the set (0 and 1) repeat, in both the vertical and horizontal directions.
                                        0 - 7, 10 -17, 20 - 27, 30 - 37 ......

Example Convert 176 in octal to decimal.

Each column represents a power of 8,
264 becomes .....
                    4 * 80 = 4
                    6 * 81 = 48
                    2 * 82 = 128
adding the results together gives 180 (in decimal)


   Octal was used extensively in early mainframe computer systems, but has become less popular in favour of binary and hexadecimal today.
 

4. Hexadecimal Number System

n mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 09 to represent values zero to nine, and A, B, C, D, E, F (or alternatively af) to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10995.

laizen.soliano

unread,
Jul 7, 2012, 6:02:29 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:Charito B. Soliano

Section:HN3

 

1. Binary Number System

     -The binary numeral system, or base-2 number system, represents numeric values using two symbols: 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2. Because of its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by almost all modern computers.



 

2. Decimal Number System

      -ecimal number system, also called Hindu-Arabic, or Arabic, number system,  in mathematics, positional numeral system employing 10 as the base and requiring 10 different numerals, the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. It also requires a dot (decimal point) to represent decimal fractions. In this scheme, the numerals used in denoting a number take different place values depending upon position. In a base-10 system the number 543.21 represents the sum (5 × 102) +  (4 × 101) + (3 × 100) + (2 × 10−1) + (1 × 10−2). See numerals and numeral systems.
 




   3.Octal Number System
    -

 OCTAL NUMBER SYSTEM

  The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary     system, it is useful in programming some types of computers.

  look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:




 

4.Hexadecimal Number system

       -A big problem with the binary system is verbosity. To represent the value 202 requires eight binary digits.

rjennyfe

unread,
Jul 7, 2012, 6:04:44 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:Jennyfe s.Ronquillo

Section:HA3

 

1. Binary Number System

 
Binary numbers are closely related to digital electronics. With digital electronics a ‘1’ means that current / electricity is present and a ‘0’ means it is not present. The different parts of a computer communicate through pulses of current (1s and 0s).
As we all know, computers can calculate complex equations and perform complex mathematics at lightening speed. Calculating using only 1s and 0s is called the BINARY SYSTEM. Although a computer will only process 1s and 0s there comes a point when the 1s and 0s have to be converted into our usual decimal numbers - that we are familiar with.
We tend to use the DECIMAL SYSTEM when attempting maths. This system deals with numbers that we are using on a daily basis: 1,2,3,4,5,6,7,8,9, 10s, 100s, 1000s etc..... As the BINARY system is composed of only two numbers (1s and 0s) you may be wandering how it is possible to count beyond one. The table below
will help you understand how this is done.

 

2. Decimal Number System

This is the most commonly used number system in use by humans today. It uses ten digits, 0 through 9. It is possibly used because humans have ten fingers, and these were used for primitive counting. There is nothing intrinsically "right" about the decimal number system, it is simply one of an infinite number. The number sixty-nine is represented by nine units and one ten, or 69.
 


3.Octal Number System

 

   

The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.

Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:

 4. Hexadecimal Number System

A big problem with the binary system is verbosity. To represent the value 202 requires eight binary digits.

The decimal version requires only three decimal digits and, thus, represents numbers much more compactly than does the binary numbering system. This fact was not lost on the engineers who designed binary computer systems.

When dealing with large values, binary numbers quickly become too unwieldy. The hexadecimal (base 16) numbering system solves these problems. Hexadecimal numbers offer the two features:

  • hex numbers are very compact
  • it is easy to convert from hex to binary and binary to hex.

The Hexadecimal system is based on the binary system using a Nibble or 4-bit boundary. In Assembly Language programming, most assemblers require the first digit of a hexadecimal number to be 0, and place an "h" at the end of the number to denote the number base.  In PICBASIC, we simply put a "$" at the left end of the number.



On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:
On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:
On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

juvymalab

unread,
Jul 7, 2012, 6:06:33 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:51:41 PM UTC+8, rey.mesajon wrote:


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name: JUVY MALABAR

Section: HA3

 

1. Binary Number System

charloyz

unread,
Jul 7, 2012, 6:09:37 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name: Charles Fernan Flordelis

Section: HN3

 

1. Binary Number System

2. Decimal Number System

3. Octal Number System

4. Hexadecimal Number System


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:
On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:
On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

mark james ramos

unread,
Jul 7, 2012, 6:10:06 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:Mark Jaime G.Ramos

Section:HN3

 

 

1. Binary Number System

juvymalab

unread,
Jul 7, 2012, 6:13:13 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

mark james ramos

unread,
Jul 7, 2012, 6:22:28 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:Mark Jaime G. Ramos

Section:HN3

 

1. Binary Number System

 Binary numbers are closely related to digital electronics. With digital electronics a ‘1’ means that current / electricity is present and a ‘0’ means it is not present. The different parts of a computer communicate through pulses of current (1s and 0s).
As we all know, computers can calculate complex equations and perform complex mathematics at lightening speed. Calculating using only 1s and 0s is called the BINARY SYSTEM. Although a computer will only process 1s and 0s there comes a point when the 1s and 0s have to be converted into our usual decimal numbers - that we are familiar with.
We tend to use the DECIMAL SYSTEM when attempting maths. This system deals with numbers that we are using on a daily basis: 1,2,3,4,5,6,7,8,9, 10s, 100s, 1000s etc..... As the BINARY system is composed of only two numbers (1s and 0s) you may be wandering how it is possible to count beyond one. The table below
will help you understand how this is done.

2. Decimal Number System

  -decimal number system, also called Hindu-Arabic, or Arabic, number system,  in mathematics, positional numeral system employing 10 as the base and requiring 10 different numerals, the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. It also requires a dot (decimal point) to represent decimal fractions. In this scheme, the numerals used in denoting a number take different place values depending upon position. In a base-10 system the number 543.21 represents the sum (5 × 102) +  (4 × 101) + (3 × 100) + (2 × 10−1) + (1 × 10−2). See numerals and numeral systems

 

3. Octal Number System

The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.

Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:


 

4. Hexadecimal Number System

keithaclc1305

unread,
Jul 7, 2012, 6:24:07 AM7/7/12
to ccm111_20...@googlegroups.com

NAME: keith Ryan lim
Section: HN3

1. Binary Number System
A set of eight trigrams and a set of 64 hexagrams, analogous to the three-bit and six-bit binary numerals, were known in ancient China through the classic text I Ching. In the 11th century, scholar and philosopher Shao Yong developed a method for arranging the hexagrams which corresponds to the sequence 0 to 63, as represented in binary, with yin as 0, yang as 1 and the least significant bit on top. There is, however, no evidence that Shao understood binary computation. The ordering is also the lexicographical order on sextuples of elements chosen from a two-element set.[7]
Similar sets of binary combinations have also been used in traditional African divination systems such as Ifá as well as in medieval Western geomancy. The base-2 system utilized in geomancy had long been widely applied in sub-Saharan Africa.


2. Decimal Number System
a positional system of numeration that uses decimal digits and a base of ten.

3. Octal Number System
a positional system of numeration that uses octal digits and a radix of eight.

4. Hexadecimal Number System
a number system having a base 16; the symbols for the numbers 0--9 are the same as those used in the decimal system, and the numbers 10--15 are usually represented by the letters A--F. The system is used as a convenient way of representing the internal binary code of a computer

princezjane23

unread,
Jul 7, 2012, 6:26:07 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 6:24:07 PM UTC+8, keithaclc1305 wrote:

NAME: LOVELY JANE KAMDAN
Section: HA3

charloyz

unread,
Jul 7, 2012, 6:26:11 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name: Charles Fernan Flordelis

Section: HN3

 

1. Binary Number System

The binary numeral system, or base-2 number system, represents numeric values using two symbols: 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2. Because of its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by almost all modern computers.



 

2. Decimal Number System


Overview - Number Systems

Probably the biggest stumbling block most beginning programmers encounter when attempting to learn assembly language is the common use of the binary and hexadecimal numbering systems. Understanding these numbering systems is important because their use simplifies other complex topics including boolean algebra and logic design, signed numeric representation, character codes, and packed data.

This section discusses several important concepts including the binary, decimal, and hexadecimal numbering systems, binary data organization (into bits, nibbles, bytes, words, and double words), signed and unsigned number systems, arithmetic, logical, shift, and rotate operations on binary values, bit fields and packed BCD (Binary Coded Decimal) data, and the ASCII (American Standard Code for Information Interchange) character set. This is basic material and the remainder of this tutorial depends upon your understanding of these concepts. If you are already familiar with these terms from other courses or study, you should at least skim this material before proceeding to the next chapter. If you are unfamiliar with this material, or only vaguely familiar with it, you should study it carefully before proceeding. All of the material in this chapter is important! Do not skip over any material.

Most modern computer systems do not represent numeric values using the decimal system. Instead, they typically use a binary or two's complement numbering system. To understand the limitations of computer arithmetic, you must understand how computers represent numbers.

Remember how mathematical operations are entered into a computer:

+ is used for addition
- is used for subtraction
* is used for multiplication
/ is used for division
^ is used to raise to a power

There are four number bases commonly used in programming. These are:

Name Base Symbol
Binary Base 2 B
Octal Base 8 Q or O
Decimal Base 10 none or D
Hexadecimal Base 16 H

The Decimal Number Base Systems

The Decimal Number System uses base 10. It includes the digits from 0 through 9. The weighted values for each position is as follows:

10^4 10^3 10^2 10^1 10^0 10^-1 10^-2 10^-3
10000 1000 100 10 1 .1 .01 .001

You have been using the decimal (base 10) numbering system for so long that you often take it for granted. When you see a number like "123", you don't think about the value 123. Instead, you generate a mental image of how many items this value represents. In reality, however, the number 123 represents:

1 * 10^2 + 2 * 10^1 + 3 * 10^0 =

1 * 100 + 2 * 10 + 3 * 1 =

100 + 20 + 3 =

123

Each digit appearing to the left of the decimal point represents a value between zero and nine times power of ten represented by its position in the number. Digits appearing to the right of the decimal point represent a value between zero and nine times an increasing negative power of ten. For example, the value 725.194 is represented as follows:

7 * 10^2 + 2 * 10^1 + 5 * 10^0 + 1 * 10^-1 + 9 * 10^-2 + 4 * 10^-3 =

7 * 100 + 2 * 10 + 5 * 1 + 1 * 0.1 + 9 * 0.01 + 4 * 0.001 =

700 + 20 + 5 + 0.1 + 0.09 + 0.004 =

725.194


My Sources / Mine kilder

Sources: Various books, the Internet, and various encyclopedias.

Kilder: Forskellige bøger, internettet og forskellige leksikoner.


Computer Data Representation and Number Systems / Computer data repræsentation og talsystemer




 

3. Octal Number System

 
 

OCTAL NUMBER SYSTEM

The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.

Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:

Table 1-3. - Binary and Octal Comparison

Unit and Number

The terms that you learned in the decimal and binary sections are also used with the octal system.

The unit remains a single object, and the number is still a symbol used to represent one or more units.

Base (Radix)

As with the other systems, the radix, or base, is the number of symbols used in the system. The octal system uses eight symbols - 0 through 7. The base, or radix, is indicated by the subscript 8.

Positional Notation

The octal number system is a positional notation number system. Just as the decimal system uses powers of 10 and the binary system uses powers of 2, the octal system uses power of 8 to determine the value of a number's position. The following bar graph shows the positions and the power of the base:

Remember, that the power, or exponent, indicates the number of times the base is multiplied by itself. The value of this multiplication is expressed in base 10 as shown below:

All numbers to the left of the radix point are whole numbers, and those to the right are fractional numbers.

MSD and LSD

When determining the most and least significant digits in an octal number, use the same rules that you used with the other number systems. The digit farthest to the left of the radix point is the MSD, and the one farthest right of the radix point is the LSD.

Example:

If the number is a whole number, the MSD is the nonzero digit farthest to the left of the radix point and the LSD is the digit immediately to the left of the radix point. Conversely, if the number is a fraction only, the nonzero digit closest to the radix point is the MSD and the LSD is the nonzero digit farthest to the right of the radix point.

Addition of Octal Numbers

The addition of octal numbers is not difficult provided you remember that anytime the sum of two digits exceeds 7, a carry is produced. Compare the two examples shown below:

The octal addition table in table 1-4 will be of benefit to you until you are accustomed to adding octal numbers. To use the table, simply follow the directions used in this example:

Add: 68 and 58

Table 1-4. - Octal Addition Table

Locate the 6 in the X column of the figure. Next locate the 5 in the Y column. The point in area Z where these two columns intersect is the sum. Therefore,

If you use the concepts of addition you have already learned, you are ready to add octal numbers.

Work through the solutions to the following problems:

As was mentioned earlier in this section, each time the sum of a column of numbers exceeds 7, a carry is produced. More than one carry may be produced if there are three or more numbers to be added, as in this example:

The sum of the augend and the first addend is 68 with a carry. The sum of 68 and the second addend is 58 with a carry. You should write down the 58 and add the two carries and bring them down to the sum, as shown below:

Now let's try some practice problems:

Q.24 Add:

answer.gif (214 bytes)

Q.25 Add:

answer.gif (214 bytes)

Q.26 Add:

answer.gif (214 bytes)

Q.27 Add:

answer.gif (214 bytes)

Q.28 Add:

answer.gif (214 bytes)

Q.29 Add:

answer.gif (214 bytes)




4. Hexadecimal Number System


Number system to the base 16, used in computing. In hex the decimal numbers 0–15 are represented by the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Hexadecimal numbers are easy to convert to the computer's internal binary code and are more compact than binary numbers.

Each place in a number increases in value by a power of 16 going from right to left; for instance, 8F is equal to 15 + (8 × 16) = 143 in decimal. Hexadecimal numbers are often preferred by programmers writing in low-level languages because they are more easily converted to the computer's internal binary (base-two) code than are decimal numbers, and because they are more compact than binary numbers and therefore more easily keyed, checked, and memorized. (See also ASCII.)

© RM 2012. Helicon Publishing is division of RM.

 

juvymalab

unread,
Jul 7, 2012, 6:26:41 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:51:41 PM UTC+8, rey.mesajon wrote:


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name: JUVY MALABAR

Section: HA3

 

1. Binary Number System

juvymalab

unread,
Jul 7, 2012, 6:27:49 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 6:02:29 PM UTC+8, laizen.soliano wrote:


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:JUVY MALABAR

Section:HA3

 

1. Binary Number System

xemaj6

unread,
Jul 7, 2012, 6:29:32 AM7/7/12
to ccm111_20...@googlegroups.com


On Saturday, July 7, 2012 5:38:08 PM UTC+8, Jeanette Vale wrote:

Name:Jessie James Claro

Section:HN3

 

1. Binary Number System

binary system, numeration system based on powers of 2, in contrast to the familiar decimal system, which is based on powers of 10. In the binary system, only the digits 0 and 1 are used. Thus, the first ten numbers in binary notation, corresponding to the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 in decimal notation, are 0, 1, 10, 11, 100, 101, 110, 111, 1000, and 1001. Since each position indicates a specific power of 2, just as the number 342 means (3 × 102) + (4 × 101) + (2 × 100), the decimal equivalent of a binary number can be calculated by adding together each digit multiplied by its power of 2; for example, the binary number 1011010 corresponds to (1 × 26) + (0 × 25) + (1 × 24) + (1 × 23) + (0 × 22) + (1 × 21) + (0 × 20) = 64 + 0 + 16 + 8 + 0 + 2 + 0 = 90 in the decimal system. Binary numbers are sometimes written with a subscript "b" to distinguish them from decimal numbers having the same digits. As with the decimal system, fractions can be represented by digits to the right of the binary point (analogous to the decimal point). A binary number is generally much longer than the decimal equivalent; e.g., the number above, 1011010b, contains seven digits while its decimal counterpart, 90, contains only two. This is a disadvantage for most ordinary applications but is offset by the greater simplicity of the binary system in computer applications. Since only two digits are used, any binary digit, or bit, can be transmitted and recorded electronically simply by the presence or absence of an electrical pulse or current. The great speed of such devices more than compensates for the fact that a given number may contain a large number of digits. 
 

2. Decimal Number System

Most commonly used number system, to the base ten. Decimal numbers do not necessarily contain a decimal point; 563, 5.63, and -563 are all decimal numbers. Other systems are mainly used in computing and include the binary number system, octal number system, and hexadecimal number system.

The decimals 0.3, 0.51, and 0.023 can be expressed as the decimal fractions 3/10, 51/100, and 23/1,000. They are all terminating decimals. These fractions can equally be expressed as the percentages 30%, 51%, and 2.3%.

Decimal numbers may be thought of as written under column headings based on the number 10. For example:




Using the table, 567 stands for 5 hundreds, 6 tens, and 7 units; 28.02 stands for 2 tens, 8 units, and 2 hundredths.

567 has no numbers after the decimal point, that is 0 decimal places. 28.02 has 2 numbers after the decimal point, that is 2 decimal places.

Large decimal numbers may also be expressed in floating-point notation.

Addition and subtraction
When adding or subtracting decimals it is important to keep the decimal points underneath each other. For example, to work out 13.56 + 4.08 + 9:

3. Octal Number System

 

The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.

Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:

Table 1-3. - Binary and Octal Comparison

sherwinnoquil

unread,
Jul 7, 2012, 6:36:44 AM7/7/12
to ccm111_20...@googlegroups.com



Name:Sherwin

Section:Noquil

 

1. Binary Number System 

binary system, numeration system based on powers of 2, in contrast to the familiar decimal system, which is based on powers of 10. In the binary system, only the digits 0 and 1 are used. Thus, the first ten numbers in binary notation, corresponding to the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 in decimal notation, are 0, 1, 10, 11, 100, 101, 110, 111, 1000, and 1001. Since each position indicates a specific power of 2, just as the number 342 means (3 × 102) + (4 × 101) + (2 × 100), the decimal equivalent of a binary number can be calculated by adding together each digit multiplied by its power of 2; for example, the binary number 1011010 corresponds to (1 × 26) + (0 × 25) + (1 × 24) + (1 × 23) + (0 × 22) + (1 × 21) + (0 × 20) = 64 + 0 + 16 + 8 + 0 + 2 + 0 = 90 in the decimal system. Binary numbers are sometimes written with a subscript "b" to distinguish them from decimal numbers having the same digits. As with the decimal system, fractions can be represented by digits to the right of the binary point (analogous to the decimal point). A binary number is generally much longer than the decimal equivalent; e.g., the number above, 1011010b, contains seven digits while its decimal counterpart, 90, contains only two. This is a disadvantage for most ordinary applications but is offset by the greater simplicity of the binary system in computer applications. Since only two digits are used, any binary digit, or bit, can be transmitted and recorded electronically simply by the presence or absence of an electrical pulse or current. The great speed of such devices more than compensates for the fact that a given number may contain a large number of digits.
 

2. Decimal Number System

Most commonly used number system, to the base ten. Decimal numbers do not necessarily contain a decimal point; 563, 5.63, and -563 are all decimal numbers. Other systems are mainly used in computing and include the binary number system, octal number system, and hexadecimal number system.

The decimals 0.3, 0.51, and 0.023 can be expressed as the decimal fractions 3/10, 51/100, and 23/1,000. They are all terminating decimals. These fractions can equally be expressed as the percentages 30%, 51%, and 2.3%.

Decimal numbers may be thought of as written under column headings based on the number 10. For example:




Using the table, 567 stands for 5 hundreds, 6 tens, and 7 units; 28.02 stands for 2 tens, 8 units, and 2 hundredths.

567 has no numbers after the decimal point, that is 0 decimal places. 28.02 has 2 numbers after the decimal point, that is 2 decimal places.

Large decimal numbers may also be expressed in floating-point notation.

Addition and subtraction
When adding or subtracting decimals it is important to keep the decimal points underneath each other. For example, to work out 13.56 + 4.08 + 9: 

3. Octal Number System

The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.

Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:


4. Hexadecimal Number System


The octal, or base 8, number system is a common system used with computers. Because of its relationship with the binary system, it is useful in programming some types of computers.

Look closely at the comparison of binary and octal number systems in table 1-3. You can see that one octal digit is the equivalent value of three binary digits. The following examples of the conversion of octal 2258 to binary and back again further illustrate this comparison:

Table 1-3. - Binary and Octal Comparison

- itago ang nakapaniping teksto -
Reply all
Reply to author
Forward
0 new messages