Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
Bits, bytes, and words 2. Numeric data representation and number bases Binary, Octal, Hexadecimal 3. Conversion between bases
1.
telecommunication In computing, a bit is defined as a variable or computed quantity that can have only two possible These two values are often interpreted as binary digits and are usually denoted by 0 and 1 In several popular programming languages, numeric 0 is equivalent (or convertible) to logical false, and 1 to true. The correspondence between these values and the physical states of the underlying storage or device is a matter of convention, and different assignments may be used even within the same device or program
telecommunications, that most commonly consists of eight bits a byte was the number of bits used to encode a single character of text in a computer and it is for this reason the basic addressable element in many computer architectures. The byte size and byte addressing are often used in place of longer integers for size or speed optimizations in microcontrollers and CPUs
used by a particular computer design A word is simply a fixed sized group of bits that are handled together by the system The number of bits in a word (the word size or word length) is an important characteristic of computer architecture. The size of a word is reflected in many aspects of a computer's structure and operation; the majority of the registers in the computer are usually word sized and the amount of data transferred between the processing part computer and the memory system, in a single operation, is most often a word
NUMBERING SYSTEM :
PLACE BASE
5TH PLACE
105
4TH PLACE
104 10,000
3RD PLACE
103 1,000
2ND PLACE
102 100
1ST PLACE
101 10
SINGLE UNIT
100 1
1ST PLACE
10-1 0.1 1/10
2ND PLACE
10-2 0.01 1/100 2-2 0.25 1/4 8-2 0.015625 1/64 16-2 3.906 X 103 1/256
3RD PLACE
10-3 0.001 1/1000 2-3 0.125 1/8 8-3 1.953125 X 103 1/512 16-3 2.441406 2 X 104 1/4096
DECIMAL
100,000
25 BINARY 32
24 16
23 8
22 4
21 2
20 1
85 OCTAL 32,768
84 4,096
83 512
82 64
81 8
80 1
164 65,536
163 4,096
162 256
161 16
160 1
Number Bases
Radix : when referring to binary, octal, decimal,
hexadecimal, a single lowercase letter appended to the end of each number to identify its type. E.g. hexadecimal 45 will be written as 45h octal 76 will be written as 76o or 76q binary 11010011 will be written as 11010011b
Number System
The following table shows the equivalent values for decimal numbers in binary, octal and hexadecimal:
Number System
Decimal system: system of positional notation based
on powers of 10.
Binary system: system of positional notation based
powers of 2
Octal system: system of positional notation based on
powers of 8
Hexadecimal system: system of positional notation
based powers of 16
Number System
Base:
The number of different symbols required to represent any
given number
The larger the base, the more numerals are required
Base 10: Base 2: Base 8:
Base 16 :
Number System
EXAMPLE:
Example #1:
1458 4348
Binary System
WHY??
Early computer design was decimal
Mark I and ENIAC
On True Yes
Off False No
Binary System
A computer stores both instructions and data as
Binary System
Each digit in binary number has a value depending on its
position Example:
The number 1002 means
(1 X 2) + ( 0 X 2) + (0 X 2)
4+0+0 4
Base 2
7/21/2013
15
Decimal System
Decimal is a base 10 numbering system
We use a system based on decimal digits to represent
numbers Each digit in the number is multiplied by 10 raised to a power corresponding to that digit position. Example : The number 472810 means : (4 X 1000) + (7 X 100) + (2 X 10) + 8 4000 + 700 + 20 +8 4728
Base 10
7/21/2013
17
Octal System
As known as base 8 numbering system
There are only eight different digits available (0, 1, 2, 3,
4, 5, 6, 7) Example :
The number 7238 means (7 X 8) + (2 X 8) + (3 X 8) 448 + 16 + 3 467
Base 8
7/21/2013
19
Hexadecimal System
Hexadecimal is a base 10 numbering system
Used not only to represent integers Also used to represent sequence of binary digits
Base 16
7/21/2013
21
2) 2) 2) 2) 2)
Base 2
21 10 5 2 1 0
(1 (0 (1 (0 (1
101010
(MSB)
* MSB (most-significant-bit) : left most bit LSB (least-significant-bit) : right most bit
Quotient
8) 8) 8)
Therefore, 21.2510
25.28
1 0 1 0 1
(LSB)
Now, (MSB) 0 1
(MSB)
Therefore, Refer to conversion of binary to hexadecimal 21.2510 = 010 101 . 0102 = 25.28
Quotient
16 ) 16 ) 16 ) 16 )
8,039 Remainder
8,039 ( 7 Least significant bit 502 ( 6 31 ( 15 1 ( 1 Most significant bit 0
Base 16
1F67
Therefore, 21.2510
15.416
1 0 1 0 1
(LSB)
Now, (MSB) 0 1
(MSB)
EXERCISES
1. Find the binary representation for 31.62510. Show your work. 1. Convert the following numbers to the respective numbering system.