what is a computer ? computers are electronic machines that process (performs calculation and...
TRANSCRIPT
![Page 1: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/1.jpg)
What is a Computer ?
• Computers are Electronic Machines
that process (performs calculation and manipulation) Data
under the control of Set of Instructions.
+ - storecompare
1234567890ABCDEF….!@#$%^&
If (x>0) y=x+5;cout<<“Hello”;
![Page 2: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/2.jpg)
What is a Computer ?
• Computers are Hardware devices that process Data
under the control of Computer Program or Software.
![Page 3: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/3.jpg)
What is a Computer ?
• Computer system:
– hardware + software
• Hardware:
– the physical components
• Software:
– the instructions that tell the hardware what to do
![Page 4: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/4.jpg)
Computing Systems
Computers have two kinds of components:
• Hardware, consisting of its physical devices (CPU, memory, bus, storage devices, ...)
• Software, consisting of the programs it has (Operating system, applications, utilities, ...)
![Page 5: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/5.jpg)
Why Computers ?
• Computers can do many different jobs because they are programmable, we are not.
• They perform computations at million times faster than us.
• They perform computations correctly every single time compared to us.
![Page 6: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/6.jpg)
Computer Hardware
• All computer systems consist of similar hardware components.
• Hardware Components can be viewed as:– Logical Components (Generic)– Physical Components (Actual Devices)
![Page 7: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/7.jpg)
Logical Hardware Components
• The CPU
• Main Memory or Primary Storage
• Auxiliary Memory or Secondary Storage– works as Input/Output device as well
• Input Devices
• Output Devices
![Page 8: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/8.jpg)
Logical Hardware Components
Arithmetic Logic Unit
Control Unit
Auxiliary StorageDevices Main Memory ( RAM & ROM )
Central Processing Unit ( CPU ) Input Devices
Output Devices
Peripherals
Data
Main Unit
Registers
![Page 9: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/9.jpg)
Logical Hardware Components
• Processor (CPU)– Central Processing Unit– Interprets and executes the instructions
• Main Memory– RAM, Temporarily holds data and
instructions– ROM, Permanently holds data and
instructions
• Auxiliary Memory– Permanently holds data and instructions
• Input device(s)– mouse, keyboard, etc.
• Output device(s)– video display, printer, etc.
Main Memory(such as RAM)
Processor(CPU)
Input Devices(such as keyboard
and mouse)
Output Devices(such as video
display or printer)
Auxiliary Memory(such as floppy &
hard drive)
![Page 10: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/10.jpg)
Physical Hardware Components• Keyboard, Mouse
– Input devices• Peripherals
• Monitor– Output device
• Peripherals• Chassis or Box
– CPU– RAM
• Main memory– Floppy & Hard disk drives
• Auxiliary memory– I/O connectors
• to connect other Peripherals
![Page 11: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/11.jpg)
Central Processing Unit
• has 3 components to execute program instructions
– Arithmetic/Logic Unit performs arithmetic operations, and makes logical comparisons.
– Control Unit controls the order in which your program instructions are executed.
– Registers holds data, memory inside the processor.
![Page 12: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/12.jpg)
CPU
Central Processing Unit (CPU):– the “brain” of the machine? Action_Centre– performs arithmetic and logical ML statements– measurement: speed in MHz ( megahertz, millions of
clock-ticks per second ) or MIPS– examples:
· Intel Pentium, · AMD K6, · Motorola PowerPC, · Sun SPARC,
![Page 13: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/13.jpg)
Two Kinds of Memory
• Main– working area, similar to our desk
– temporarily stores program and data (while program is executing)
• Auxiliary– permanent (more or less) , similar to our bookshelf
– saves program and results
– includes floppy & hard disk drives, CDs, tape, etc.
![Page 14: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/14.jpg)
Main Memory Unit
• is an ordered sequence of storage cells, each capable of holding a piece of information
• each cell has its own unique address
• the information held can be input data, computed values, or your program instructions.
![Page 15: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/15.jpg)
RAM
Random Access Memory (RAM)– “main” memory, which is fast, but volatile...– analogous to a person’s short-term memory.– many tiny “on-off” switches: for convenience
• “on” is represented by 1, “off” by 0.
– each switch is called a binary digit, or bit.• 8 bits is called a byte.
• 210 bytes =1024 bytes is called a kilobyte (1K)
• 220 bytes is called a megabyte (1M).
![Page 16: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/16.jpg)
Memory Organization
• two circuit states of digital electronics correspond to 0 and 1
• bit (binary digit) refers to a single 0 or 1. • Bit patterns represent both the computer instructions
and computer data
• 1 byte = 8 bits
• 1 KB = 1024 bytes
• 1 MB = 1024 x 1024 = 1,048,576 bytes
![Page 17: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/17.jpg)
Main Memory Organization
• Bit = one binary digit – Binary digit can have only
one of two values, 0 or 1• Byte = 8 bits
– “Byte is Addressable”– Main memory is a list of
numbered locations that contain one byte of data in each location
– Number of bytes per data item may vary
Address Data Byte
3021 1111 0000 Item 1: 2 bytesstored
3022 1100 1100
3023 1010 1010 Item 2: 1 bytestored
3024 1100 1110 Item 3: 3 bytesstored
3025 0011 0001
3026 1110 0001
3027 0110 0011 Item 4: 2 bytesstored
3028 1010 0010
3029 … Next Item, etc.
![Page 18: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/18.jpg)
How Many Possible Digits?
• binary (base 2) numbers use 2 digits: JUST 0 and 1
• decimal (base 10) numbers use 10 digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F
• hexadecimal (base 16) numbers use 16 digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F
![Page 19: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/19.jpg)
Disks
Secondary Memory (Disk):– Stable storage using magnetic or optical media.– Analogous to a person’s long-term memory.– Slower to access than RAM.– Examples:
• floppy disk (measured in kilobytes)
• hard disk (measured in gigabytes (230 bytes))
• CD-ROM (measured in megabytes), ...
![Page 20: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/20.jpg)
Auxiliary Storage Organization
![Page 21: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/21.jpg)
Peripherals
• are input, output, or auxiliary storage devices attached to a computer
– Input Devices include keyboard and mouse, microphone, camera.
– Output Devices include printers, video display, LCD screens, speakers.
– Auxiliary Storage Devices include disk drives, CD-ROM and DVD-ROM drives.
![Page 22: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/22.jpg)
The Bus
– Connects CPU to other hardware devices.– Analogous to a person’s spinal cord.– Speed measured in megahertz (like the CPU),
but typically much slower than the CPU...– The bottleneck in most of today’s PCs.
![Page 23: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/23.jpg)
Cache
While accessing RAM is faster than accessing secondary memory, it is still quite slow, relative to the rate at which the CPU runs.
To circumvent this problem, most systems add a fast cache memory to the CPU, to store recently used instructions and data.
(Assumption: Since such instructions/data were needed recently, they will be needed again in the near future.)
![Page 24: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/24.jpg)
Connected Together
Putting the pieces together:
CPU
Bus
MainMemory
SecondaryMemorycache
Programs are stored (long-term) in secondary memory, and loaded into main memory to run, from which the CPU retrieves and executes their statements.
![Page 25: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/25.jpg)
Software
• Operating Systems– DOS, MS- Windows(3.x, 95, 98, NT), MacOS,
UNIX, etc.
• Application Software– word-processor/editor– web browser– compiler or assembler– etc.
![Page 26: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/26.jpg)
OS
The OS acts as the “manager” of the system, making sure that each hardware device interacts smoothly with the others.
It also provides the interface by which the user interacts with the computer, and awaits user input if no application is running.
Examples: MacOS, Windows-95, Windows-NT, UNIX, Linux, Solaris, ...
![Page 27: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/27.jpg)
OS
The operating system (OS) is loaded from secondary storage into main memory when the computer is turned on, and remains in memory until the computer is turned off.
RAM DiskCPUCache
Bus
OS
![Page 28: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/28.jpg)
Applications
Applications are non-OS programs that perform some useful task, including word processors, spreadsheets, databases, web browsers, C++ compilers, ...
Example C++ compilers/environments: – CodeWarrior (MacOS, Win95, WinNT, Solaris)
– GNU C++ (UNIX, Linux)
– Turbo/Borland C++ (Win95, WinNT)
– Visual C++ (Win95, WinNT)
![Page 29: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/29.jpg)
Putting it all together
Programs and applications that are not running are stored on disk.
RAM DiskCPUCache
Bus
OS App
![Page 30: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/30.jpg)
Putting it all together
When you launch a program, the OS controls the CPU and loads the program from disk to RAM.
RAM DiskCPUCache
Bus
OS AppAppOS
![Page 31: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/31.jpg)
Putting it all together
The OS then relinquishes the CPU to the program, which begins to run.
RAM DiskCPUCache
Bus
OS AppAppApp
![Page 32: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/32.jpg)
The Fetch-Decode-Execute Cycle
As the program runs, it repeatedly fetches the next instruction (from memory/cache), executes it, and stores any results back to memory.
RAM DiskCPUCache
Bus
OS AppApp
App
That’s all a computer does: fetch-execute-store, millions of times each second!
![Page 33: What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions](https://reader036.vdocument.in/reader036/viewer/2022081514/56649e4f5503460f94b4740c/html5/thumbnails/33.jpg)
Summary
A computer has two kinds of components:
– Hardware: its CPU, RAM, Disk(s), …
– Software, its OS, Applications, and User Programs.