Title: Hardware: How Computer Programs Run on Physical Machines
1Hardware How Computer Programs Run on Physical
Machines
2News
- Schedule for the rest of the semester
- Nov 14, 16, 21 circuits and hardware
- Nov 23 No Class (Thanksgiving)
- Nov 28 Internet and WWW
- Nov 30 Artificial Intelligence
- Dec 5 Social Impacts of Computing
- Dec 7 Exam 3
- Dec X Final Exam
- Read chapter 4 of your textbook
3The hardware level of a computer
- Binary numbers are used to encode all forms of
data, such as numbers and letters - Electric circuits process and store binary data
- Simple gates can be combined to build circuits
for any computation - Boolean logic is a useful abstraction of electric
circuits
These are the topics well be discussing today
and next week
4The binary number system
- Binary digits (bits) have values 0 and 1
- The position of each digit determines its value
- for example, the binary number 101011 equals
- 1x25 0x24 1x23 0x22 1x21 1x20
- 32 0 8 0 2
1 4310 - note the similarity with decimal numbers
- 57210 5x102 7x101 2x100
5Binary numbers can represent all types of data
- negative integers reserve the leading bit for
sign (0positive 1negative) - letters ASCII codes (using 8 bits1 byte)
- A 01000001, B01000010, C01000011,
and so on
6Internal vs external forms of data
- Internal External
- 00..01010112 4310
- 10..01010112 -4310
- 01000001001000102 AB
7Calculating in binary
- First practice counting to 2010 in binary
- Practice adding 10112 1012
- Try subtracting 10112 - 1012
8Why use binary, not decimal or ...?
- At the hardware level, data is manipulated and
stored with electrical circuits - So, data must correspond to electronic
quantities, such as voltage and current - A decimal computer could be built using an
electrical device with 10 voltage levels - But, the device would not be reliable!
9Electrical devices with 2 states are the most
reliable
- 2 states which are hard to confuse
- full on - full off
- fully charged - fully discharged
- charged positively - charged negatively
- magnetized - nonmagnetized
- magnetized clockwise - magnetized ccw
These states are separated by a huge energy
barrier.
10A Switch is a 2-state device that can be toggled
- A relay is a switch built with an electromagnet
when the controlling current is 1, the
electromagnet pulls the switch closed, and the
controlled current flows through the switch
11Switches can do it all
- With switches we can implement AND, OR, and NOT
gates - With just those types of gates, we can design
circuits to perform any computation
12Basic electric circuits Computing AND
13Basic electric circuits Computing OR
14Basic electric circuits Computing NOT
15A better switch Transistors
- bi-stable, solid state device
- switching is done electronically, not
mechanically - no moving parts therefore, fast, small,
reliable - can switch states in about one 10 billionth of a
second - about 5 million transistors can fit on a chip 1
centimeter square. Density is increasing rapidly
with new technology.
16Summary
- Computers use binary numbers for storage and
computation because - all types of data can be stored this way
- 2-state devices are highly reliable
- A switch is a 2-state device that can be toggled
- Switches can implement AND, OR, and NOT gates
- With these gates, we can perform any computation,
as well see next time!