1. CST-20363-Intro-to-CS
“Let me tell you why you’re here. You are here because you know
something. What you know, you can’t explain. But you feel it.”
- Morpheus, ‘The Matrix' (1999).
Session 1
“In the Bitginning”
2. Understanding Your Computer: Bits and Bytes: The Language of Computers
Bit
• Binary digit
• 0 or 1
Byte
• Unique combinations of 8 bits of 0s
and 1s
3. bit – smallest capacity
nibble = 4 bits
1 byte = 2 nibbles = 8 bits
1 kilobyte (KB) = 1024 bytes
1 megabyte (MB) = 1024 KB
1 gigabyte (GB) = 1024 MB
1 terabyte (TB) = 1024 GB
1 petabyte (PB) = 1024 TB
1 exabyte (EB) = 1024 PB
Storage Capacities
For Example, in as 32-bits
Microprocessor how
many bytes we have?
32-bit is a type of CPU architecture that is capable of transferring
32 bits of data per clock cycle. ... In more technical terms, this
means processors can work with 32-bit binary numbers (decimal
number up to 4,294,967,295)
5. Processing and Memory on the Motherboard The Motherboard and Memory
Motherboard
• CPU
• ROM, RAM, and cache
• Slots for expansion cards
• Sound/Video cards
• Network interface cards (NIC)
6. RAM (Random Access Memory)
RAM is the main memory space of
your computer. The term RAM
means Random Access Memory, and
it comes from the early days of
computers when mainframes had
two types of memory: Random
access, in which any bit of memory
could be addressed at any moment;
and Sequential memory (such as
data stored on tape) where bits
could only be accessed in a certain
order. All of the memory in your
computer is random access, so don’t
worry about sequential memory.
The RAM is the workspace of your
computer. If your computer has
more RAM, it can open more and
larger programs and documents
simultaneously. Same as you having
a large worktable to spread work
papers out on instead of a tiny desk.
The documents you are currently
editing (and the programs your
computer is using to let you do it)
are stored in the RAM.
7. ROM (Read-Only Memory)
Microcomputers also have some
ROM (Read Only Memory) on the
motherboard. ROM does not need
power to remember its contents,
so this is where a computer stores
the programs that are needed to
start up (boot up) the computer
system. (The instructions can’t be
stored in RAM, since RAM loses its
contents when the computer is
off; and they can’t be kept on the
hard disk, since just reading data
from a hard disk requires
programs.)
When the computer is first turned
on, the program stored in the
ROM is feed to the processor. This
initial program checks to see that
everything is in order and looks
for storage devices on which it
can locate a copy of the operating
system; it then loads the first part
of the OS into RAM, then hands
control over to that program to
finish the boot process.
8. CMOS
The “CMOS memory” of a
computer is a small amount of
“semi-permanent” storage where
changeable data can be stored
that needs to remain available
while the computer is turned off.
A small battery on the
motherboard keeps the CMOS
‘alive’ when power is off.
The CMOS memory (called PRAM,
or “Parameter RAM” on the
Macintosh) can store such
information such as what hard
drive or copy of the OS you want
to boot from, what are your
default monitor settings, etc. The
BIOS picks up this information
and uses it during boot up. The
CMOS memory can also hold the
time and date so that your
computer remembers this even
when power its has been off. If
your computer can’t remember
the proper time, or can’t
remember system settings when
it’s off, the small battery may
need to be replaced.
9. CPU
CPU Performance Measures
• Processor speed measured in hertz (Hz)
• Megahertz (MHz) or gigahertz (GHz)
• Number of cores
• Single
• Dual
• Quad
• Ten
11. Understanding System Software: Operating System Fundamentals
Operating system basics
• Operating system
• Utility programs
Operating system functions
• Manages computer’s hardware
• Allows application software to work with CPU
• Manage, schedule, coordinate tasks
12. What the Operating System Does: The User Interface
O S—Coordinates and directs the flow of data and
information
12
13. Understanding System Software: Operating System
User Interface
• Way user interacts with computer
• Desktop, icons, and menus
Utility Program
• Performs general housekeeping tasks
Multitask
• Perform more than one process at a
time
13
14. What the Operating System Does: The User Interface
Enables user to interact with the computer
Types of interfaces:
1. Command-driven interface
2. Menu-driven interface
3. Graphical user interface (G U I)
14
15. What the Operating System Does: The User Interface (History)
The GUI was first developed at Xerox PARC by Alan Kay,
Larry Tesler, Dan Ingalls, David Smith, Clarence Ellis and a
number of other researchers.
It used windows, icons, and menus (including the first
fixed drop-down menu) to support commands such as
opening files, deleting files, moving files, etc.
In 1974, work began at PARC on Gypsy, the first bitmap
What-You-See-Is-What-You-Get (WYSIWYG) cut & paste
editor.
WYSIWYG
15
18. Understanding System Software: Operating Systems for Machinery, Networks,
and Business
Real-Time O S (R T O S)
• Machine that performs repetitive series of
specific tasks in precise time
Multiuser Operating System
• Known as network O S
• Allows multiple users access to the computer at the
same time
• Unix
18
20. Binary Numbers (Bit)
A binary digit is called a bit.
Usually expressed as 0 and 1 the two numbers of the binary numbering system.
A bit is the smallest unit of information a computer can use. A 16 bit computer would process a series of
16 bits, such as
0100111101011000 in one go, repeating the process thousands or millions of times per second.
Reading a series of bits is very difficult and to make this process easier they are often displayed in groups
of 4 bits.
This grouping is quite interesting in that a group of 4 bits can be replaced by a single hexadecimal digit.
Two groups of 4 bits, i.e. 8 bits ( a byte) can be replaced by 2 hexadecimal digits, and 4 hexadecimal digits
are required to replace all 16 bits.
0100 1111 0101 1000
21. Byte
A group of 8 bits are in a byte. With 8 bits ( binary digits ), there exists 256 possible denary combinations.
If you remember that 1 byte can store one alphabetical letter, single digit, or a single character/symbol, such as #.
Large numbers of bytes can be expressed by kilobytes, megabytes etc
1 byte of memory can normally hold one of the following:
a single alphabetical letter (upper or lower case),
a single number 0-9
a symbol ( _ + £ # > etc
a further 127 alternative characters. These could be the letters used in foreign languages, lines to produce boxes
etc.
22. Decimal Numbers (Base 10)
Decimal Numbers
102 101 100
2 0 3
In other words, 2 × 102 + 3 × 100 = 200 + 3 = 203.
Decimal Number has only nine symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and then we reuse the same symbols in a system called
“POSITIONAL NOTATION”
Decimal Number is considered the Base Ten System, because when we run out of symbols we need to add another one
to the left (e.g.10, 11, 12)
For example, to represent the number 203 in base 10, we know we place a
3 in the 1’s column, a 0 in the 10’s column and a 2 in the 100’s column. This is
expressed with exponents in the table below.
23. Binary Theory
Binary is a Base Two Number System that uses two mutually exclusive states to represent
information.
A binary number is made up of elements called bits where each bit can be in one of the two
possible states.
We represent binary numbers with the numerals 1and 0.
We also talk about them being true and false.
Virtually all electronic computers are designed to operate internally with all information encoded in
binary numbers. This is because it is relatively simple to construct electronic circuits that generate
two distinct voltage levels (i.e., off and on or low and high) to represent zero and one.
The reason is that transistors and capacitors, which are the fundamental components of
Microprocessors and memory, generally have only two distinct states: OFF and ON. (0 ,1)
24. Binary Numbers (Base 2)
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
To represent the same number in binary (203), we would have the following
table.
Binary Numbers
That equates to: 27 + 26 + 23+21 + 20
= 128 + 64 + 8 + 2 + 1 = 203.
27 26 25 24 23 22 21 20
1 1 0 0 1 0 1 1
25. Hexadecimal Numbers (Base 16)
Hexadecimal refers to a base 16 number system. We use this in computer science for only one reason, it
makes it easy for humans to think about binary numbers.
Computers only ever deal in binary and hexadecimal is simply a shortcut for us humans trying to work with
the computer.
The hexadecimal system is commonly used by programmers to describe locations in memory because it
can represent every byte (i.e., eight bits) as two consecutive hexadecimal digits instead of the eight digits
that would be required by binary (i.e., base 2) numbers and the three digits that would be required with
decimal
byte
Decimal 2. 4 0 8
Binary 1 0 1 0 1 0 1 1
Hexadeci
mal
8 8
26. Decimals to Hexadecimal Numbers (Base 16)
NOTES DIVISION RESULT
REMAINDER
HEXADECIMAL
Start by dividing the number by 16, that
is
(1128/16).1128 divided by 16 is 70.5.
So the integer division result is 70 (throw
out anything after the decimal point).
Record it on the RESULT column.
The remainder is (70.5 - 70) multiplied
with 16; or (0.5 times 16), which is 8.
Record it on the REMAINDER column.
1128 /
16
70 8
HX 0 1 2 3 4 5 6 7 8 9 A B C D E F
DE 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Example 1
Convert the number 1128 DECIMAL to HEXADECIMAL
27. Decimals to Hexadecimal Numbers (Base 16)
NOTES DIVISION RESULT
REMAINDER
HEXADECIMAL
Then, divide the result again by 16,
that is
70/16.
The number 70 on the DIVISION
column comes from the previous
RESULT In this case, 70/16 =
4.375. So the integer division result
is 4 (throw out anything after the
decimal point)
The remainder is 0.375 multiplied
with 16, which is 6.
70 / 16 4 6
Example 1
Convert the number 1128 DECIMAL to HEXADECIMAL
28. Decimals to Hexadecimal Numbers (Base 16)
NOTES DIVISION RESULT
REMAINDER
HEXADECIMAL
Repeat.
Note here that 4/16 = 0.25. So the
integer division result is 0.The
remainder is (0.25-0) multiplied with
16, which is 4.
4 / 16 0 4
Now we Stop because the result is
already 0 (0 divided by 16 will always
be 0)
Well, here is the answer. These
numbers come from the REMAINDER
column values (read from bottom to
top)
468
Example 1
Convert the number 1128 DECIMAL to HEXADECIMAL
29. Decimals to Hexadecimal Numbers (Base 16)
DIVISION RESULT REMAINDER HEXADECIMAL
Example 2
Convert the number 100 DECIMAL to HEXADECIMAL
DIVISION RESULT REMAINDER HEXADECIMAL
100 / 16 6 4
6/16 0 6
ANSWER 64
Example 3
Convert the number 188 DECIMAL to HEXADECIMAL
DIVISION RESULT REMAINDER HEXADECIMAL
Note: the answer would not be 1112, but BC. Remember to write down the remainder in hex, not decimal.
DIVISION RESULT REMAINDER HEXADECIMAL
188 / 16 11 C (12 decimal)
11 / 16 0 B (11 decimal)
ANSWER BC
30. Alphanumeric Numbers
Alphanumeric Numbers (Upper case Base 36)
0 1 2 3 4 5 6 7 8 9
A B C D E F G H I J
K L M N O P Q R S T
U V W X Y Z
Alphanumeric Numbers (Upper & Lower case Base 62)
0 1 2 3 4 5 0 1 2 3
A B C D E F G H I J
K L M N O P Q R S T
U V W X Y Z
a b c d e f g h i j
k l m n o p q r s t
u v w x y z
Computers need a language they understand. Binary language, consists of two digits: 0 and 1.
Each 0 and 1 is a binary digit, or bit for short. Eight binary digits (or bits) combine to create one byte.
In computers, each letter, number, and special character consists of a unique combination of eight bits.
Files can be quite large, containing thousands or millions of bytes.
The motherboard is located inside the system unit and contains the central electronic components of the computer, including the computer's processor (CPU), and many circuit boards that help the computer to function.
The motherboard includes slots for expansion cards, which provide additional functionality.
Sound cards connect speakers and a microphone. Video cards provide connections for the monitor.
Network interface cards enable your computer to connect with other computers and provide high-speed Internet connections.
System software consists of two primary types of programs, the operating system and utility programs.
The operating system has three primary functions.
• It manages the computer’s hardware.
• It provides a consistent means for application software to work with the central processing unit.
• It is responsible for the management, scheduling, and coordination of tasks.
The operating system is like an orchestra's conductor. It coordinates and directs the flow of data and information through the computer system.
Other functions of the operating system include the user interface, which is how users interact with the computer. It includes desktop, icons, and menus.
A utility program is a small program that performs many of the general housekeeping tasks for your computer, such as system maintenance and file compression. A set of utility programs is bundled with each OS.
When operating systems were originally developed, they were designed for a single user performing one task at a time. Modern operating systems provide the ability to multitask, which means that the computer can perform more than one process at a time.
The OS provides a user interface that lets you interact with the computer.
In a command-driven interface, you enter commands to communicate with the computer system.
A menu-driven interface is one in which you choose commands from menus displayed on the screen. This eliminated the need for users to know every command.
Current operating systems use a graphical user interface (GUI). GUIs display graphics and use the point-and-click technology of the mouse and cursor.
The OS provides a user interface that lets you interact with the computer.
In a command-driven interface, you enter commands to communicate with the computer system.
A menu-driven interface is one in which you choose commands from menus displayed on the screen. This eliminated the need for users to know every command.
Current operating systems use a graphical user interface (GUI). GUIs display graphics and use the point-and-click technology of the mouse and cursor.
Figure 5.1 lists a number of common operating systems.
Specialized operating systems are needed for machinery, networks, and business.
Machinery that performs a repetitive series of specific tasks in an exact amount of time requires a real-time operating system (RTOS).
Multiuser operating systems allow multiple users access to the computer at the same time.
UNIX is a multiuser, multitasking OS that is used as a network OS.