21
Introduction to Introduction to Computer Computer Organization Organization Representing and Representing and Manipulating Data Manipulating Data CSTA Day 2 CSTA Day 2 Rodrigo A. Obando Rodrigo A. Obando

Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Introduction to Introduction to Computer OrganizationComputer Organization

Representing and Manipulating DataRepresenting and Manipulating Data

CSTA Day 2CSTA Day 2

Rodrigo A. ObandoRodrigo A. Obando

Page 2: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

What is a System?What is a System?

According to dictionary.com:According to dictionary.com:

A group of interacting, interrelated, or A group of interacting, interrelated, or interdependent elements forming a complex interdependent elements forming a complex

whole.whole. "system.""system." The American Heritage® Dictionary of the English Language, Fourth The American Heritage® Dictionary of the English Language, Fourth

EditionEdition. Houghton Mifflin Company, 2004. 07 Nov. 2006. <Dictionary.com . Houghton Mifflin Company, 2004. 07 Nov. 2006. <Dictionary.com http://http://

dictionary.reference.comdictionary.reference.com/browse/system/browse/system>>

Page 3: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Computer SystemsComputer Systems

A computer system is a particular type of A computer system is a particular type of system that its primary purpose is that of system that its primary purpose is that of performing computations. Before the time of performing computations. Before the time of the electronic computers, a computer was a the electronic computers, a computer was a person that performed computations.person that performed computations.

A computer system is composed of a Central A computer system is composed of a Central Processing Unit (Control Unit and Arithmetic Processing Unit (Control Unit and Arithmetic & Logic Unit), Memory and Input/Output & Logic Unit), Memory and Input/Output subsystems.subsystems.

Page 4: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Computer System OverviewComputer System Overview

CU

ALU

Input/Output Memory

Page 5: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Central Processing Unit (CPU)Central Processing Unit (CPU)

The Central Processing Unit is composed of a The Central Processing Unit is composed of a Control Unit and an Arithmetic & Logic Unit.Control Unit and an Arithmetic & Logic Unit.

The Control Unit The Control Unit controlscontrols the different the different components of the system and it is responsible components of the system and it is responsible for fetching, decoding and executing the for fetching, decoding and executing the instructions of a program.instructions of a program.

The Arithmetic & Logic Unit is performs The Arithmetic & Logic Unit is performs arithmetic and logical operations such as arithmetic and logical operations such as addition, division, comparison, etc.addition, division, comparison, etc.

Page 6: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Control Unit (CU)Control Unit (CU)

The Control Unit is the part of the CPU that The Control Unit is the part of the CPU that fetches (reads) instructions from memory.fetches (reads) instructions from memory.

Each instruction is decoded to determine what Each instruction is decoded to determine what exactly it is supposed to do.exactly it is supposed to do.

Once decoded, each instruction is executed.Once decoded, each instruction is executed. The cycle continues until the system is The cycle continues until the system is

powered down.powered down.

Page 7: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Fetch, Decode, and Execute Fetch, Decode, and Execute CycleCycle

Fetch

DecodeExecute

Page 8: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Arithmetic & Logic Unit (ALU)Arithmetic & Logic Unit (ALU)

The Arithmetic & Logic Unit (ALU) performs the The Arithmetic & Logic Unit (ALU) performs the arithmetic operations as well as the logical arithmetic operations as well as the logical operations.operations.

The arithmetic operations include addition, The arithmetic operations include addition, subtraction, multiplication and division.subtraction, multiplication and division.

The logical operations are commonly used to The logical operations are commonly used to compare values and determine whether they are compare values and determine whether they are greater, lesser or equal to one another.greater, lesser or equal to one another.

These operations are normally carried out with These operations are normally carried out with registers that are part of the CPU.registers that are part of the CPU.

Page 9: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

ALU and RegistersALU and Registers

Register 1 Register 2 Register 3

ALU

Bus A

Bus B

Bus C

Page 10: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Storage (Memory)Storage (Memory)

The Storage subsystem is a unit that is capable of The Storage subsystem is a unit that is capable of retrieving and saving instructions as well as data.retrieving and saving instructions as well as data.

There are two main types of storage: Primary Storage There are two main types of storage: Primary Storage and Secondary Storage.and Secondary Storage.

Primary Storage is the memory that is immediately Primary Storage is the memory that is immediately available to the CPU and it is normally fast (RAM or available to the CPU and it is normally fast (RAM or Random Access Memory).Random Access Memory).

Secondary Storage is indirectly available to the CPU Secondary Storage is indirectly available to the CPU and it is typically slower. (Hard disks, tapes, etc.)and it is typically slower. (Hard disks, tapes, etc.)

Page 11: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Input/Output (I/O)Input/Output (I/O)

The I/O subsystem is critical since it is the one The I/O subsystem is critical since it is the one responsible for receiving and sending data to responsible for receiving and sending data to the outside world. The computer would be the outside world. The computer would be useless to us without this system.useless to us without this system.

There are many devices that can be used for There are many devices that can be used for input and/or output. Typical input devices are input and/or output. Typical input devices are keyboards, mice, and graphics tablets. Typical keyboards, mice, and graphics tablets. Typical output devices are screens and force-feedback output devices are screens and force-feedback joysticks.joysticks.

Page 12: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Number SystemsNumber Systems

Everything that the computer handles is stored in the Everything that the computer handles is stored in the form of numbers. The numbers are meaningless by form of numbers. The numbers are meaningless by themselves and we need to associate significance so themselves and we need to associate significance so that they can be useful.that they can be useful.

We associate symbols with the concept of a number We associate symbols with the concept of a number and, for example, the number three is represented and, for example, the number three is represented with the symbol 3. The symbol is not the number with the symbol 3. The symbol is not the number three but a placeholder for its concept.three but a placeholder for its concept.

Page 13: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Decimal Number SystemDecimal Number System

We use the decimal number system in our We use the decimal number system in our daily lives. It is called the decimal system daily lives. It is called the decimal system because it uses 10 distinct symbols: 0, 1, 2, 3, because it uses 10 distinct symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.4, 5, 6, 7, 8, and 9.

We can represent any number by combining We can represent any number by combining these symbols. The number three million these symbols. The number three million seven hundred forty eight thousand and three seven hundred forty eight thousand and three hundred twenty one can be represented with hundred twenty one can be represented with 3748321.3748321.

Page 14: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Decimal Numbers in ComputersDecimal Numbers in Computers

If we want a computer to use the decimal If we want a computer to use the decimal number system we need to have devices number system we need to have devices capable of storing, retrieving and manipulating capable of storing, retrieving and manipulating ten values or primitive symbols.ten values or primitive symbols.

Although possible, this system would be Although possible, this system would be subject to error and deterioration and would subject to error and deterioration and would imply a short lifetime.imply a short lifetime.

Page 15: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Binary Number SystemBinary Number System

What is the simplest number system we could What is the simplest number system we could use?use?

We could use the unary number system but it We could use the unary number system but it does not lend itself to simple and speedy does not lend itself to simple and speedy manipulation in terms of arithmetic and other manipulation in terms of arithmetic and other operations.operations.

We use the Binary Number System inside the We use the Binary Number System inside the computers. This system only has two symbols, computers. This system only has two symbols, 0 and 1.0 and 1.

Page 16: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Binary Number System in Binary Number System in ComputersComputers

Besides the physical (electronics) reasons for Besides the physical (electronics) reasons for using binary there are also mathematical using binary there are also mathematical advantages.advantages.

Boolean Algebra is an area of mathematics Boolean Algebra is an area of mathematics that studies the properties of the binary system. that studies the properties of the binary system. It provides us with an excellent foundation not It provides us with an excellent foundation not only to design the electronic parts of a only to design the electronic parts of a computer but also to develop algorithms to computer but also to develop algorithms to expedite computations.expedite computations.

Page 17: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Examples of Binary Numbers and Examples of Binary Numbers and Some OperationsSome Operations

343410 10 = 100010= 10001022

3310 10 = 11= 1122

3748321374832110 10 = 1110010011000111100001= 111001001100011110000122

232310 10 + 74+ 741010 = 97 = 971010

101111011122 + 1001010 + 100101022 = 1100001 = 110000122

748074801010 / 10 / 101010 = 748 = 7481010

1000010110100001011022 / 10 / 1022 = 100001011 = 10000101122

Page 18: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Coding InformationCoding Information

We usually assign meaning to different We usually assign meaning to different symbols. As long as we agree on what symbol symbols. As long as we agree on what symbol has what meaning we are able to communicate has what meaning we are able to communicate with each other using those symbols.with each other using those symbols.

We can use 0 and 1 in place of We can use 0 and 1 in place of nono and and yesyes. . They could also mean They could also mean closedclosed and and openopen, , agreeagree and and disagreedisagree, , badbad and and goodgood..

Page 19: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Coding TextCoding Text

One of the very useful coding schemes we One of the very useful coding schemes we used with computers is the coding of text used with computers is the coding of text characters.characters.

The ASCII code is widely used throughout the The ASCII code is widely used throughout the computing world. Every character has a binary computing world. Every character has a binary code and we can represent text by using binary code and we can represent text by using binary numbers and interpreting them as characters.numbers and interpreting them as characters.

ASCII is a subset of UNICODE which is used ASCII is a subset of UNICODE which is used to encode international symbols.to encode international symbols.

Page 20: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

ASCII TableASCII Table

Page 21: Introduction to Computer Organization Representing and Manipulating Data CSTA Day 2 Rodrigo A. Obando

Rodrigo A. ObandoRodrigo A. Obando

Text, Images and SoundText, Images and Sound

In the same way that we code text we can code In the same way that we code text we can code virtually anything.virtually anything.

An image is basically a rectangle of dots and An image is basically a rectangle of dots and each dot is of a certain color. The color of each dot is of a certain color. The color of these dots can be represented by a number.these dots can be represented by a number.

Sound may be represented as a sequence of Sound may be represented as a sequence of numbers indicating how to move a speaker.numbers indicating how to move a speaker.