Computing Fundamentals: Course Instructor: Engr - Noshina Shamir Lecturer CPED
Computing Fundamentals: Course Instructor: Engr - Noshina Shamir Lecturer CPED
Computing Fundamentals: Course Instructor: Engr - Noshina Shamir Lecturer CPED
Course Instructor:
Engr.Noshina Shamir
Lecturer CPED
Number Systems
Number Systems are employed in arithmetic to
represent numbers by strings of digits. There are
two types of number systems:
Positional number systems:
The meaning of each digit depends on its position
in the number.
Example:
585.5 is a decimal number in positional code
5 hundreds plus 8 tens plus 5 units plus 5
tenths.
(1011.01)2=1*2^3+0*2^2
+1*2^1+1*2^0.0*2^1+1*2^-2
=8+0+2+1.0+.25
=(11.25)10
Other Conversions
Other Conversions
Octal to Binary:
convert each digit to binary using 3 bits
(475.2)8 = (100 111 101. 010)2
Hexadecimal to Binary:
convert each digit to binary using 4 bits
(7A5F.C)16 = (0111 1010 0101 1111. 1100)2
= (111101001011111.11)2
Hexadecimal to Octal
Hexadecimal to Binary to Octal
Octal to Hexadecimal
Octal to Binary to Hexadecimal
Arithmetic Operations
Arithmetic operations
with numbers in base r
follow the same rules as
for decimal numbers.
Examples: addition,
subtraction, and
multiplication in base-2.
In Digital Computers
arithmetic operations are
done with the binary
number system (base-2) Binary Arithmetic.
Binary Codes
Digital system represent and manipulate not only
binary numbers, but also other discrete element
of information represented with a binary code(i-e
pattern of 0s and 1s).
An n-bit binary code is group of n bits that
assumes up to 2^n distinct combination of 1s
and 0s ,with each combination representing one
element of the set that is being encoded.
A set of four elements require combination of
two bits.
Binary Codes
The bit combination of an n-bit code is
determined from the count in binary 0 to 2^n-1.
Each element is assigned a unique binary bit
combination, no two elements can have the same
value; otherwise, code assignment will be
ambiguous.
Although the minimum number of bits required
to code 2^n distinct quantities in ,there is no
maximum number of bits that may be used for
binary code.
BCD CODE
BCD CODE
The BCD value has 12 bits to encode the characters of the decimal value,
but the equivalent binary number needs only 8 bits.
It is obvious that the representation of a BCD number needs more bits
than its equivalent binary value. However, there is an advantage in the use
of decimal numbers, because computer input and output data are
generated by people who use the decimal system.
It is important to realize that BCD numbers are decimal numbers and not
binary numbers, although they use bits in their representation. The only
difference between a decimal number and BCD is that decimals are
written with the symbols 0, 1, 2, 9 and BCD numbers use the binary code
0000, 0001, 0010, 1001. The decimal value is exactly the same. Decimal
10 is represented in BCD with eight bits as 0001 0000 and decimal 15 as
0001 0101.
The corresponding binary values are 1010 and 1111 and have only four
bits.
BCD Addition
add the BCD digits as if they were binary numbers.
When the binary sum is equal to or less than 1001
(without a carry), the corresponding BCD digit is
correct.
However, when the binary sum is greater than or
equal to 1010, the result is an invalid BCD digit.
The addition of 6 = (0110)2 to the binary sum
converts it to the correct digit and also produces a
carry as required. This is because a carry in the most
significant bit position of the binary sum.
Gray Code
The output data of many physical systems are
quantities that are continuous. These data must
be converted into digital form before they are
applied to a digital system. Continuous or analog
information is converted into digital form by
means of an analog todigital converter. It is
sometimes convenient to use the Gray code
shown in Table.
The advantage of the Gray code over the straight
binary number sequence is that only one bit in
the code group changes in going from one
number to the next.
The Gray code is used in applications in which the
normal sequence of binary numbers generated by
the hardware may produce an error or ambiguity
during the transition from one number to the
next.
Format effectors are characters that control the layout of printing. They
include the familiar word processor and typewriter controls such as
backspace (BS), horizontal tabulation (HT), and carriage return (CR).
Information separators are used to separate the data into divisions such as
paragraphs and pages. They include characters such as record
separator(RS) and file separator (FS).
The communicationcontrol characters are useful during the transmission
of text between remote devices so that it can be distinguished from other
messages using the same communication channel before it and after it.
Examples of communicationcontrol characters are STX (start of text) and
ETX (end of text), which are used to frame a text message transmitted
through a communication channel.
ASCII is a sevenbit code, but most computers manipulate an eightbit
quantity as a single unit called a byte.