Lab activity 2

4 views
Skip to first unread message

Francis Quibo

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

Name:Francis A Quibo

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.


joeyandrewacosta

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


On Saturday, July 7, 2012 6:07:20 PM UTC+8, Francis Quibo wrote:

Name:Joey Andrew A. Acosta

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
-
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:


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
-
The hexadecimal (base 16) number system operates the same way as the decimal (base 10) number system, except it is based on sixteen instead of ten. The operation of the decimal system is familiar.
The 4-digit base-10 number 5826 appears below, indicating how the value of the number is derived from the values of its 4 digits.
Everybody knows that 5826 means five-thousand eight-hundred twenty-six. But only because they have been taught that 1, 10, 100, and 1000 are part of the calculation even though they are never written. All that is actually written is a total of twenty-one (5 and 8 and 2 and 6). Only the interpretation that people supply, which is purely mental and unwritten, informs what is written with its intended value.
Hexadecimal operates the same way. Each digit is "weighted" by a "multiplier," with the results all added together. The multipliers in both systems are the powers of the system base (10 or 16). The powers of 10 are 1, 10, 100, 1000, etc. while those of 16 are 1, 16, 256, 4096, etc. So the same digits "5826" used in base 16 represent a value calculated as follows:
Though the digits are the same (5826) the values come out quite different, because the base and its "multiplier values" are different.
You will see hexadecimal numbers some of whose digits are letters instead of numbers. That's because the number of digits needed by any number system is the number's base. So base base 2 needs 2 digits, base 10 needs 10,  and base 16 needs 16. Base 2 has 0 and 1. Base 10 has 0 through 9. Base 16 borrows 0 though 9 but needs another 6. For those, we could invent some symbols. However, for convenience we employ the first 6 letters of the alphabet (A through F) instead. When we run out of digits at 9, we use A as the next digit. So A represents the value 10. B comes next, and represents 11. The hexadecimal digits and thevalue they stand for are:
Hexadecimal digit Value
0
0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A 10
B 11
C 12
D 13
E 14
F 15
 
Here's the derivation of the value of another 4-digit hexadecimal number, but this one uses some of the high-order digits A-F:
The highest you can count with a given number of digits (in any number system) is the number in which every digit contains the maximum value in the number system (1 in base 2, or 9 in base 10, or F in base 16). So the largest number you can represent with 4 digits in base 16 is:
Counting any higher than that would require that you utilize more digits. The very next number is 10000 in hexadecimal, or 65536 in decimal. It is a well-known value in computer science and is called "64K."




Reply all
Reply to author
Forward
0 new messages