710 likes | 898 Views
Chapter 2 Processing Data. Dept. of Computer Engineering Khon Kaen University. Major Concepts. Data vs. information Why a computer uses the binary number How a computer processes data CPU Memory Factors that affect processing speed CPUs used in modern personal computers
E N D
Chapter 2 Processing Data Dept. of Computer Engineering Khon Kaen University
Major Concepts • Data vs. information • Why a computer uses the binary number • How a computer processes data • CPU • Memory • Factors that affect processing speed • CPUs used in modern personal computers • Connecting to external devices
Data Information • Computer devices can only recognize two distinct states produced by electricity, magnetic polarity, or reflected light • All they can understand: on or off • The CPU consists of several millions tiny electronic switches called transistors. • In the strictest sense, data consists of raw numbers that computer programs turn this data into useful information
To a computer, everything is a number Represented as 0 0000 0000 1 0000 0001 2 0000 0010 3 0000 0011 For computer, the word “are” is represented by Represented as a 0110 0001 r 0111 0010 e 0110 0101 How a Computer Represents Data
Number Bases • A number base is a specific collection of symbols on which a number system can be built • The number base familiar to us is base 10, upon which the decimal number is built. • There are ten symbols, 0 through 9 • What do we do to represent a number greater than 9? • Each symbol in a number is called a digit
Number Bases (Cont.) • Besides base 10 (the decimal number), other number systems are • The binary number system: base 2 • Numbers: 0, 1 • The octal number system: base 8 • Numbers: 0, 1, 2, 3, 4, 5, 6, 7 • The hexadecimal number system: base 16 • Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f
Major Concepts • Data vs. information • Why a computer uses the binary number • How a computer processes data • CPU • Memory • Factors that affect processing speed • CPUs used in modern personal computers • Connecting to external devices
Numbers in a Computer • In a computer, all data must be reduced to electrical switches • A switch has only two states – “ON” or “OFF” • It has only two numeric symbols • 0 stands for “OFF” and 1 stands for “ON” • Computers function in a binary number system (base 2) • When a computer needs to represent a quantity greater than 1, it uses more than one digit
Bits and Bytes • When referring to computerized data, each switch – whether on or off – is called bit • The term bit is a contraction of binary digit • A bit is the smallest possible unit of data • To represent anything meaningful – that is to convey information • The computer needs groups of bits • The larger unit of data is byte, which is a group of 8 bits
Bytes • With one byte (8 binary digits), the computer can represent up to 256 different values • 0 to 255 • One byte combination is an enough unit to represent all the English characters on the keyboard • Including all letters (uppercase and lowercase), numbers, punctuation marks, and other symbols
Text Codes • The programmers need a standard code which is a group of numbers to represent or standard for letters of the alphabets, punctuation marks, and other symbols • Three of the most popular systems are • EBCDIC • ASCII • Unicode
EBCDIC • EBCDIC: Extended Binary Coded Decimal Interchange Code • EBCDIC was defined by IBM • Eight-bit code can define 256 symbols • Used in IBM mainframe and mid-range systems • Rarely encountered in personal computers because EBCDIC makes the coding difficult and miss some characters, such as []\
ASCII • American Standard Code for Information Interchange • ASCII is the seven bits code • Specify characters up to 127 • ASCII is the most common character set • It is easy to write code to manipulate upper/lowercase letters • It is also easy to check for valid data ranges
UNICODE • UNICODE provides a unique number for every character • No matter what the platform, the program, and the language • UNICODE represents each symbol by two bytes – 16 bits (represents up to 65536) • The UNICODE standard has been adopted by several industry leaders and is required by modern standards, such as XML
Major Concepts • Data vs. information • Why a computer uses the binary number • How a computer processes data • CPU • Memory • Factors that affect processing speed • CPUs used in modern personal computers • Connecting to external devices
How a Computer Processes Data • There are two components which handle processing data • The central processing unit, or CPU • The memory • Both components are located on the computer main system board (mother board)
The CPU • The CPU is the brain of the computer, where data is manipulated • In a microcomputer, the entire CPU is contained on a tiny chip called microprocessor • The chip has at least two basic parts • The control unit • The arithmetic logic unit
The Control Unit • The CPU’s instructions for carrying out commands are built into the control unit • Each instruction in the instruction set is expressed in microcode- a series of basic directions that tell the CPU how to execute more complex operations • The control unit dictates how and when each specific instruction is to be performed.
The Arithmetic Logic Unit (ALU) • Since all computer data is stored as numbers, the computer needs a unit that carries out mathematic operations • The ALU can perform two types of operations • Arithmetic operations • Logical operations
The ALU (Cont.) • When the control unit encounters an instruction that involves arithmetic or logic, it passes that instruction to the ALU • The ALU includes a group of registers • What is a register? • A high speed memory built directly inside the CPU • Hold the data currently being processed
Memory • The CPU cannot store large sets of data or entire programs permanently • The CPU has only small space of its memory (registers) • The CPU needs millions of bytes of memory for holding programs and data being manipulated • The CPU needs memory (an electronic chip) • Two types of built-in memory • Permanent – nonvolatile • Non-permanent – volatile
ROM • ROM stands for Read-Only Memory • The computer users can only read data but cannot write data into the memory • ROM: nonvolatile memory chips • When a computer is turned off, the content of the memory is still there • Many kinds of ROM • EPROM: Erasable-Programmable ROM • EEPROM: Electrically EPROM
RAM • RAM stands for Random-Access Memory • Data can be read and changed by computer users • RAM is volatile • When a computer is turned off, the memory content disappears • RAM consists of some chips on a small circuit board
RAM Technologies • Fast Page Mode (FPM) RAM: the oldest • Extended Data Output (EDO) RAM: faster than FPM • Burst Extended Data Output (BEDO) RAM: fast, but can be used in a specific computer brand • Synchronous Dynamic RAM (SDRAM): fast and used in modern CPUs
RAM Technologies (Cont.) • Double Data-Rate Synchronous RAM (DDR SDRAM or DDR): The fastest • Memory chips are usually grouped together on small circuit boards • Single In-line Memory Module (SIMM) • Double In-line Memory Module (DIMM) • SIMMs have a row of memory on one side of the board, but DIMMs have a row of memory on both sides of the board
Accessing the Data in Memory • The CPU stores and retrieves each piece of data using memory address • Memory address is a number indicates a location on the memory chips • Memory addresses start at zero and go up to one less than the number of bytes of memory
Memory Access To request a byte of data, the CPU sends a memory address to RAM
Major Concepts • Data vs. information • Why a computer uses the binary number • How a computer processes data • CPU • Memory • Factors that affect processing speed • CPUs used in modern personal computers • Connecting to external devices
Factors Affecting Processing Speed • Computing power of the computer: the speed with which the computer processes data • Several reasons that the computer speed increases • The less distance between transistors inside CPU • The faster CPU’s register • The more powerful memory and the cache memory • The faster clock speed • The wider data bus • The faster math coprocessor
How Registers Affect Speed • The size of the registers, called word size, indicates the amount of data with which the computer can work at any given time • The bigger word size, the more quickly the computer can process a set of data • When we refer to 32-bit processor or 64-bit processor, we usually refer to the size of the register inside the processor chip
Memory and Computing Power • The amount of RAM in a computer can have a profound effect on the computer’s power • More RAM means the computer can use bigger, more powerful programs, and can access larger data files
The Computer Clock Speed • Every microcomputer has a system clock to time its processing operation • Clocks speeds has increased steadily • First PC operated at 4.77 megahertz • Nowadays PC operated at 2 gigahertz • Hertz is a measure of cycles per second • Megahertz (MHz) means millions of cycles per second • A CPU operating at 300 MHz can process data more than twice as fast as the same one operating at 133 MHz
The Bus • The bus refers to the electrical paths between the components of a group of parallel wires • There are two types of bus • The data bus • The address bus
The Data Bus • The bus for carrying data • The number of wires in the bus affects the speed at which data can travel between components • Each wire can transfer one bit at a time • Bus Standards • Industry Standard Architecture (ISA) bus: 16-bit bus • Peripheral Component Interconnect (PCI) bus: 32-bit and 64-bit bus
The Address Bus • The address bus is a set of wires that connects the CPU and RAM and carries the memory address • The number of wires in address bus determines the maximum number of memory addresses • Today most CPUs have 32-bit address buses that can address up to 2^32 (4 Gigabytes of RAM)