Lect01 IntroToHW-1 PDF
Lect01 IntroToHW-1 PDF
• Prescribed:
– Deitel & Deitel, C How to Program, Prentice Hall
• Recommended:
– King K.N., C Programming: A Modern Approach,
Norton
– Brookshear, J.G., Computer Science: An Overview,
Benjamin-Cummings
– Kernighan & Ritchie, The C Programming Language,
Prentice Hall
1
People Involved
• Lectures
– Naveen Kumar
– Email: [email protected]
• Laboratory
– Teaching Assistants - 2
2
Computer Systems Overview
3
Transistor
Collector
Base
“Water Transistor”
Emitter
“semi-conductor”
Binary digit or “bit”:
0 off
1 on
4
Transistor (cont)
Collector
Base
Emitter
off : 0
5
Transistor
Collector
Base
Emitter
on : 1
6
Transistor
Collector
Base
Emitter
7
Gates
• Gate: a group of transistors
• Gates are switches that distinguish between
two electrical voltages:
– Current is low => 0
– Current is high => 1
• Types:
A B A AND B A OR B
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1
10
Gates and Boolean Algebra (cont)
NOT Gate
A NOT A
0
1
11
Gates and Boolean Algebra (cont)
A sequence of bits at a time:
A = 1 1 0 0 1 1 0 1
B = 0 1 1 0 0 1 1 0
A AND B =
• Symbolically we represent
– Presence of voltage as “1”
– Absence of voltage as “0”
Computer system basics
• An electronic device can represent uniquely only one of two things
– Each “0” or “1” is referred to as a Binary Digit or Bit
– Fundament unit of information storage
• To represent more things we need more bits
– E.g. 2 bits can represent four unique items: 00, 01, 10,11
– k bits can distinguish 2k distinct items
• Combination binary bits together can represent some items, info.
or data. E.g. 01000001 can be
1. Decimal value 65
2. Alphabet (or character) ‘A’ in ASCII notation
3. Command to be performed e.g. Performing AND optn.
We can divide the a computer into three broad parts
or subsystems: 1. Central Processing Unit (CPU),
2. main memory and
3. input/output subsystem.
Data registers
Program counter
Instruction register
Computer System
MAIN MEMORY
MAIN MEMORY
Example 2
A computer has 128 MB of memory. Each word in this
computer is eight bytes. How many bits are needed to
address any single word in memory?
Solution
The memory address space is 128 MB, which means 227.
However, each word is eight (23) bytes, which means that
we have 224 words. This means that we need log2 224, or 24
bits, to address each word.
0 or 1
• Cache memory
– faster than main memory (less than 20ns access
speed), but more expensive
– contains data which the CPU is likely to use next
29
Features of Computers -- Reliability
Factors that affect reliability:
• heat, ventilation, “over-clocking”, power surges
30