Download presentation
Presentation is loading. Please wait.
Published byBertha Robbins Modified over 8 years ago
1
© Jalal Kawash 2010 Introduction Peeking into Computer Science 1
2
© Jalal Kawash 2010Peeking into Computer Science Reading Assignment Mandatory: Chapter 1 Optional: None 2
3
Computers, Zeros, and Ones The big picture 3
4
© Jalal Kawash 2010Peeking into Computer Science Objectives At the end of this section, the student will be able to: 1. Name the 5 basic components of a computer & identify their functions 2. Explain how processor speed is measured 3. Understand Dual-Core architectures 4. Describe the operation of Hard disks and optical CDs 5. Describe the memory hierarchy 6. Understand how information is represented in a computer by 0s and 1s
5
© Jalal Kawash 2010Peeking into Computer Science Computers Computers are general purpose machines ◦Music/Movies ◦Communication ◦More complex operation 5
6
CPU Control Unit (CU) Arithmetic and Logic Unit (ALU) Registers Main Memory Hard Disk Other I/O devices bus
7
© Jalal Kawash 2010Peeking into Computer Science Central Processing Unit CPU is the brain of the computer Also called processor Has two components: ◦Arithmetic and Logic Unit (ALU) Simple arithmetic and logic operations ◦Control Unit Controls the operations of the rest of the machine Has a scratch pad ◦Collection of registers Connected to the rest of the system components CPU Control Unit (CU) Arithmetic and Logic Unit (ALU) Registers
8
© Jalal Kawash 2010Peeking into Computer Science The Bus 8 CPU Control Unit (CU) Arithmetic and Logic Unit (ALU) Registers Main Memory Hard Disk Other I/O devices bus
9
© Jalal Kawash 2010Peeking into Computer Science Signals No signal (0 bit) Signal (1 bit) Signal is absent An unlit lamp Represents a 0 Signal is present A lit lamp Represents a 1 9
10
© Jalal Kawash 2010Peeking into Computer Science Robot’s World 10
11
© Jalal Kawash 2010Peeking into Computer Science Robot’s World 1111111111 1ooo1o1oo1 1ooo1o1oo1 1oo11o1oo1 1ooo1o1oo1 1ooo1oooo1 1oooooooo1 1111111111 11
12
© Jalal Kawash 2010Peeking into Computer Science Main Memory Random Access Memory Holds programs and Data for CPU Every thing the CPU operates on (executing a program, playing a song, working on a file) must be in RAM Volatile: do not hold data if power is lost Need non-volatile storage
13
© Jalal Kawash 2010Peeking into Computer Science Disks Non-volatile Storage Electro-magnetic signals that stay in the absence of power
14
© Jalal Kawash 2010Peeking into Computer Science Other Input/Output Devices Printer Keyboard Screen Mouse Etc …
15
© Jalal Kawash 2010Peeking into Computer Science Cache Memory Fast Memory that sits between main memory and CPU
16
© Jalal Kawash 2010Peeking into Computer Science CPU Operation
17
17 ALU A A+B B A B C Registers ALU input Registers Accumulator (ALU output register) CU signal to ADD Main Memory
18
© Jalal Kawash 2010Peeking into Computer Science Talking Gigahertz What does a 3.0 GHz CPU mean? CPU can perform about 3 billion micro- instructions per second
19
© Jalal Kawash 2010Peeking into Computer Science Dual Core? A Computer that contains two CPUs on the same chip
20
20 Main Memory Hard Disk Other I/O devices Cache Processor Chip CPU1 CU ALU Registers CPU2 CU ALU Registers
21
© Jalal Kawash 2010Peeking into Computer Science Storage Units Byte = 8 bits Kilobyte = 1024 bytes Megabyte = 1024 Kilobytes ◦1,048,576 bytes Gigabyte = 1024 Megabytes ◦1,073,741,824 bytes Terabyte = 1024 Gigabyte ◦1,099,511,627,776 bytes
22
© Jalal Kawash 2010Peeking into Computer Science Memory Hierarchy
23
© Jalal Kawash 2010Peeking into Computer Science Magnetic (Hard) Disk 23 spindle platter arm movement Read/write head
24
© Jalal Kawash 2010Peeking into Computer Science CD-ROMs Disk Label Protective Lacquer Layer Reflective Layer Dye Layer Plastic Layer 1.2 mm reflected laser beam pit A pit prevents a laser beam from being reflected
25
Information Coding Beyond images 25
26
© Jalal Kawash 2010Peeking into Computer Science Objectives At the end of this section, the student will be able to: 1. Understand how characters are represented by 0s and 1s 2. Understand the encoding and decoding process 3. Find the minimum number of bits needed to code character information
27
© Jalal Kawash 2010Peeking into Computer Science Fixed-Length Codes Symbols in a computer’s memory are stored as 0s and 1s Each symbol is given a fixed-length code ASCII codes: ◦A is 0100 0001 ◦B is 0100 0010 ◦C is 0100 0011 ◦D is 0100 0100 ◦E is 0100 0101 ◦Etc.. 27
28
© Jalal Kawash 2010Peeking into Computer Science Fixed-Length Codes The Word ACE is stored in a computer as: 010000010100001101000101 ACE 28
29
© Jalal Kawash 2010Peeking into Computer Science More ASCII Codes 29
30
© Jalal Kawash 2010Peeking into Computer Science A Counting Problem If the alphabet has two letters only (say 0 and 1), how many one-letter words can be formed? Only two possibilities exist 0 1 So, two words 30
31
© Jalal Kawash 2010Peeking into Computer Science A Counting Problem Think of it this way: We have a box that can fit one ball only Balls have one of two colors How many distinct boxes can we produce? 31
32
© Jalal Kawash 2010Peeking into Computer Science A Counting Problem If the alphabet has two letters only (say 0 and 1), how many two-letter words can be formed? Bigger box Can hold 2 balls 32
33
© Jalal Kawash 2010Peeking into Computer Science A Counting Problem If the alphabet has two letters only (say 0 and 1), how many two-letter words can be formed? 00 01 10 11 So, four words 33
34
© Jalal Kawash 2010Peeking into Computer Science A Counting Problem If the alphabet has two letters only (say 0 and 1), how many three-letter words can be formed? 000, 001, 010, 011, 100, 101, 110, 111 So, eight words 34
35
© Jalal Kawash 2010Peeking into Computer Science A Counting Problem If the alphabet has two letters only (say 0 and 1), how many n-letter words can be formed? 2 n words 35
36
© Jalal Kawash 2010Peeking into Computer Science A Counting Problem If the alphabet has β letters, how many n-letter words can be formed? β n words 36
37
© Jalal Kawash 2010Peeking into Computer Science Back to Coding Assume we have a file that contains data composed of 6 letters (symbols) only: A, I, C, D, E, and S (for space) ACE DICE AIDE CAID EAD DAICED … 37
38
© Jalal Kawash 2010Peeking into Computer Science Back to Coding Assume we have a file that contains data composed of 6 letters (symbols) only: A, I, C, D, E, and S (for space) ACESDICESAIDESCAID EADSDAICED … 38
39
© Jalal Kawash 2010Peeking into Computer Science Coding If the file has 1000 characters, how many bits (0s and 1s) are needed to code the file? 39
40
© Jalal Kawash 2010Peeking into Computer Science Coding The first question is How many symbols do we need to represent each character? The objective is to keep the size of the file as small as possible We have 6 characters (messages) and two alphabet symbols (0 and 1) 2 is not enough, since 2 2 is 4 40
41
© Jalal Kawash 2010Peeking into Computer Science 2 bits are not enough 00 for A 01 for S 10 for I 11 for E We cannot represent the rest C and D 3 works, since 2 3 is 8, so we can represent up to 8 characters and we only have 6 41
42
© Jalal Kawash 2010Peeking into Computer Science 3 bits are more than enough Say 000 for A 001 for S 010 for I 011 for E 100 for C 101 for D 110 not used 111 not used 42
43
© Jalal Kawash 2010Peeking into Computer Science Coding If the file has 1000 characters, how many bits (0s and 1s) are needed to code the file? Each character needs 3 bits Hence, we need 3x1000 = 3000 bits 43
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.