3. Representing Data In Bytes
Here is an important thing to keep in mind:
A single byte can represent many different kinds of data.
What data it actually represents depends on how the
computer uses the byte.
For instance, the byte: 01000011
can represent the integer 67, the character 'C', the 67th decibel
level for a part of a sound, the 67th level of darkness for a dot in
a picture, and other kinds of data too.
5. Integer numbers are represented by counting in binary.
Think for a minute how we count in decimal. We start with 0 and
every new thing we count, we go to the next decimal digit.
When we reach the end of the decimal digits (9), we use two
digits to count by putting a digit in the "tens place" and then
starting over again using our 10 digits.
Thus, the decimal number 10 is a 1 in the "tens place" and a
zero in the "ones place".
Eleven is a 1 in the "tens place" and a 1 in the "ones place".
And so on.
If we need three digits, like 158, we use a third digit in the
"hundred's place".
6. We do a similar thing to count in binary - except now
we only have two digits: 0 and 1.
So we start with 0, then 1, then we run out of digits, so
we need to use two digits to keep counting.
Thus two is 10 binary: a 1 in the "two's place" and a 0
is the "one's place".
Three is 11: a 1 in the "two's place" and a 1 in the
"one's place". We ran out of digits again!
Thus, four is 100: a one in the “four's place" a 0 in the
"two's place" a 0 in the "one's place".
7. What "places" we use depends on the counting system. In our
decimal system, which we call Base 10, we use powers of 10.
Ten to the zero power is 1, so the counting starts in the "one's
place".
Ten to the one power is 10, so the counting continues in the
"ten's place".
Ten to the second power (10 squared) is 100, so we continue in
the "hundred's place". And so on.
Binary is Base 2. Thus, the "places" are two to the zero power
("one's place"), two to the one power ("two's place"), two to the
second power ("four's place"), two to the third power ("eight's
place"), and so on.
8. When you look at a byte, the rightmost bit is the "one's place".
The next bit is the "two's place", then the "four's place", then the
"eight's place", and so on.
So, when we said that the byte: 01000011
represents the decimal integer 67, we got that by adding up a 1
in the "ones place" and 1 in the "two's place" and a 1 in the
"64's place" (two to the 6 power is 64). Add them up 1+2+64=
67.
The largest integer that can be represented in one byte is:
11111111
which is 128+64+32+16+8+4+2+1 = 255.
Thus, the largest decimal integer you can store in one byte is
255. Computers use several bytes together to store larger
integers.
9. The following table shows some binary counting:
Numbers, as known in the
decimal-system
Equivalent byte in binary
system
0 00000000
1 00000001
2 00000010
3 00000011
4 00000100
5 00000101
6 00000110
7 00000111
8 00001000
11. The computer also uses a single byte to represent a single
character. But just what particular set of bits is equivalent to
which character?
In theory we could each make up our own definitions, declaring
certain bit patterns to represent certain characters.
Needless to say, this would be about as practical as each
person speaking his or her own special language.
Since we need to communicate with the computer and with
each other, it is appropriate that we use a common scheme for
data representation.
That is, there must be an agreement on which groups of bits
represent which characters.
12. The ASCII Representation has been adopted as a
standard by the United States Government and is
found in a variety of computers, particularly
minicomputers and microcomputers.
The following table shows part of the ASCII Coding.
Note that the byte 01000011 does represent the
character 'C'.
14. Thus, when you type a 'C' on the keyboard, circuitry on
the keyboard and in the computer converts the 'C' to
the byte:
01000011
and stores the letter in the computer's memory as well
as instructing the monitor to display it.
The Figure below shows the letter ‘K’ being converted
to an equivalent byte in ASCII Coding System.
16. Character Representation
If the person typed the word "CAB", it would be
represented by the following three bytes in the
computer's memory:
01000011 C
01000001 A
01000010 B
Think of it as three rows of eight switches in memory
being ON or OFF.
17. Other types of Data
Other types of data such as pictures, graphics, sound,
etc are stored in a similar manner to that of integers
and characters.
We shall however not go into the details of how other
data types are stored.
18. Which Byte Represent What?
The byte 01000011 can represent
the integer 67,
the character 'C',
a pixel with darkness level 67, OR
a sample of a sound with decibel level 67.
There are other types of data that a byte can represent too.
If that same byte can be all of those different types of data, how
does the computer know what type it is?
19. The answer is the context in which the computer uses the
byte.
If it sends the byte to a speaker, the 67th level of sound is
produced.
If it sends the byte to a monitor or printer, a pixel with the
67th level of darkness is produced, etc.
More accurately, if the byte were coded with a standard
coding technique, like ASCII for characters, GIF for
pictures, and WAV for sounds, then when the computer
sends the byte to a device, the data corresponding to that
coding is produced by the device.
21. What is an Operating System?
An operating system (commonly abbreviated OS and O/S) is
the infrastructure software component of a computer system; it
is responsible for the management and coordination of activities
and the sharing of the limited resources of the computer.
An Operating System performs several functions which
include the following:
i) Management of Processes
An Operating System (OS) manages the running of multiple
processes; ensuring that the hardware resources are utilized
efficiently. Some of the Operating Systems allow a process to
be assigned a priority which affects its allocation of CPU time.
OS may also provide some level of feedback in which the task
with which the user is working receives higher priority.
22. In some cases, there is a background process which would be
running when no other process is waiting for the CPU.
ii) Management of Memory
Operating Systems coordinate the memories by tracking which
one is available and which one should be allocated or
deallocated. It also manages the swapping of processes /
programs between the main memory and secondary memories;
as well as the creation of a virtual memory, if that becomes
necessary. The operating system tracks all memory used by
each process so that when a process terminates, all memory
used by that process will be available for other processes.
iii) Management of Files
The Operating System is used to create, maintain and manage
the file structure in a computer system. It is responsible for the
organization and tracking of directories and files that are saved
or retrieved from a disk.
23. To be specific, the Operating System enables a user to perform
various tasks, such as creating directories and files, copying
and moving files, renaming files and deleting files. In addition, it
keeps track of the exact location of files on a hard drive.
iv) Management of Peripheral Devices
The Operating System (OS) manages the use of peripheral
devices (such as keyboards, mices, printers, etc) through the
use of their individual or respective device drivers. When a new
peripheral is connected to the computer, that device's driver is
installed into the Operating System. Operating Systems perform
basic tasks, such as recognizing input from the keyboard,
sending output to the display screen, and managing print jobs to
a printer. It also provides for the User Interface (command line
interface or graphical user interface – GUI) as a communication
channel from the computer users.
24. Interface to Computers
Particularly important for the development of “user-friendly”
computers is the graphical user interface (GUI).
The GUI allows the user to interact with the computer through
icons (graphic symbols) on the screen. These icons can
represent a variety of things, including computer disks, folders,
documents, and software programs.
The user instructs the computer to perform particular tasks by
pointing to and manipulating the appropriate icons with a
mouse.
Operating systems that are not GUI-capable, require the user to
input commands by typing in words or pressing specially
defined keys. This set-up is called a command-line interface.
25. Timesharing
Another feature of the operating systems in a multiuser
environment is timesharing.
This is an arrangement where the Operating System
assigns to each “job” a fraction of the processor’s time.
An efficient operating system controls the multiuser
environment in such a way that the user feels as though he
or she is the only person using the computer.
26. Multitasking
Operating systems that allow only one user to run one
program at a time are called single user or single tasking
operating systems.
Most current operating systems and computers have
moved beyond this stage to multitasking.
In multitasking, the operating system allows more than one
task or program to be executed at a time.
Multitasking’s approach is that of efficiently utilizing the
CPU by processing two or more programs at the same
time.
27. Under multitasking a task is not necessarily a whole
program. A task can also refer to a thread of execution
when one process / program is divided into sub tasks.
A thread is the smallest sequence of programmed
instructions (a program) that can be managed (or
processed) independently by an operating system.
In Multitasking, the task does not hold on to the CPU until
it finishes but rather have a fair share amount of the CPU
time.
28. Multithreading
Multithreading is the ability of an operating system to
execute different parts of a program, called threads,
simultaneously.
The programmer must carefully design the program in
such a way that all the threads can run at the same time
without interfering with each other.
The execution of these threads can either be through one
CPU or more than one CPU.
The Operating System divides processing time not only
among different programs, but also among each thread
within a program.
29. Multiprocessing
Computers, especially mainframe and minicomputer
systems, can also employ multiprocessing.
In this process, the operating system uses more than one
processor or CPU to execute the programs / tasks.
The operating system sends instructions to several
processors in parallel, which results in the faster
processing of instructions.
Each processor can also deploy other features such as
time-sharing and multi-tasking.
30. Some of the common Operating Systems include
the following:
1. DOS (Disk Operating System): This is usually for single-
user Computers and is not GUI capable.
2. Macintosh Operating Systems (Mac OS): This was the
first commercial GUI platform. The newer versions support
multitasking, multiple web browsers, and have networking
capability.
3. Microsoft Windows: These are GUI-capable, multitasking
operating systems. There has been several versions of
Windows. The newer windows operating systems take
advantage of todays more powerful microprocessor chips
which to facilitate faster processing.
31. 4. Linux: This is one example of an operating system that is
not a proprietary software. It is an example of an open-
source software.
Its code has been made publicly available. This allows
users to customize the software to meet their personal
needs and to share improvements made with others.
There are over 300 Linux Distributions which include the
following: Slackware, Redhat, RHEL, Fedora, CentOS,
SuSe, Gentoo, Debian, Ubuntu, Knoppix, Debian,
Mandriva, etc.