emt1111 logic and problem solving lecture 2 dr. benito mendoza

46
EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Upload: jayson-fitzgerald

Post on 26-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

EMT1111 Logic and Problem SolvingLecture 2

Dr. Benito Mendoza

Page 2: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

2

Outline• What is computation?• What is a computer?• Hardware• Software• Bits and Bytes• Data (storing and transmitting)• Programming Languages• Computer Networks

Page 3: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

3

What is Computation?• Computation is the manipulation of data by either humans or machines

Page 4: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

4

What is a computer?

• A computer is a device capable of performing arithmetic and logical operations at speeds much faster than human.

• A computer is able to:

– Accept input

– Do computation (manipulate data executing logical and arithmetic operations)

– Output data

Page 5: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

5

People!

Computers used to refer to people

In WWII, computers were people who did difficult calculations by hand, for things like ballistic tables.

Page 6: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Modern Computers

Page 7: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

7

Computer categories

• A microcomputer is a computer that can perform all of its input, process, output, and storage activities by itself.

• A minicomputer is often used in situations where a microcomputer is not powerful enough but a mainframe is too expensive.

• A mainframe is a large, expensive, but powerful computer that can handle hundreds or thousands of input/output operations.

• A supercomputer is the fastest, most powerful, and most expensive computer used for applications that require complex and sophisticated mathematical calculations.

Page 8: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Other classifications of computer systems

• Personal computer• Stand-alone computer• Server• Client computer• Network computer• Workstation• Terminal• Embedded System

Page 9: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

It’s All About the Switch

• The basic component of most digital circuitry is a simple switch.

• A switch’s function, “switches” values:–On or Off–True or False–1 or 0

Page 10: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Electronic Switch

• Early computers used vacuum tubes as switches• Later, transistors were used as substitutes

Page 11: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Switches for Boolean Circuits

• Switches can be used to construct more complicated functions, such as Boolean circuits (AND on left, OR on right)

Page 12: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

12

Manipulations of the underlying data (binary code) is done by using electronic gates.

Page 13: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

A Very Interesting Switch

Transistors have three features that make them the fundamental element of the computer revolution:• Size• Quantity• Speed

Page 14: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

SizeOriginally very large

Shockley transistor Kilby integrated circuit

Page 15: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Intel’s first CPU

By 1971, Intel had created a “computer on a chip,” the 4004 microprocessor, the size of a fingernail with 2300 transistors.

Page 16: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

16

Silicon transistor timeline

You will learn more on about this in future courses

Page 17: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Moore’s Law

• Gordon Moore is one of the founders of the chip maker Intel

• In 1965, he observed the growth rate of the number of transistors in a circuit

• Made a famous prediction that the number of transistors on a chip doubles every 18 months for the same cost– He observed that roughly, this has been the case since 1965

Page 18: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza
Page 19: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Parts of a computer

Computer organization and architecture

Page 20: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Main Components

• Hardware– Physical Devices: processor, memory, keyboard, monitor,

mouse, etc.• Software

– Executable Programs: word processor, spread sheet, internet browser, etc.

• Users– People, other hardware and software.

Page 21: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Hardware

processor primarystorage

secondary storage

input device

output device

network

Page 22: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Processor

• The processor is the “brain” of a computer. • The processor controls the other devices and

performs calculations

Page 23: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Primary Storage

• Stores instructions and data for current programs• Other names: primary memory, main memory, RAM

(Random Access Memory)• Memory is “dynamic” as it requires power to retain

information

Page 24: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Peripheral Devices

• Secondary storage devices– Disk (hard & floppy), tape, USB drives, flash drives, etc.

• Input devices– Keyboard, mouse, camera, microphone, etc.

• Output devices– Monitor, printer, speaker, etc.

• Network– Wireless, Bluetooth, Ethernet, etc.

Page 25: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Secondary Storage

• Nonvolatile -- information is recorded magnetically so power is not needed

• Disks hold Gigabytes (billions of bytes)• Cheaper, but slower than primary storage• Not accessed directly by the CPU

Page 26: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Software

• The programs available for execution• Classification

– System software– Application software

Page 27: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

System Software

• Operating system (OS)– Manages system resources– Provides an interface to the user: interface with operating

system – Popular Oss: Windows, Mac OS, Linux, Unix

Page 28: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Application Software

• Programs that perform specific tasks for the user (and use the operating system to interact with the hardware)

• Examples: word processor, spreadsheet, internet browser.

Page 29: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

What is a Program?

• A sequence of instructions written in machine language that tells the CPU to take certain actions in a specific order

• In this course you will learn to create programs

Page 30: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Program Storage

• Machine language instructions are encoded as bit patterns

• Memory can only hold binary info• A bit is represented by two-states (e.g. L-R

magnetism, high-low voltage)• It takes many bits to represent reasonable amounts of

information

Page 31: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

31

Programming Languages

Page 32: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

32

Programming languages• Eventually, every program must be translated into a machine language (1’s and 0’s) that the computer can understand.

• This translation is performed by compilers, interpreters, and assemblers.

• When you buy software, you normally buy an executable version of a program. – This means that the program is already in

machine language.

Page 33: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Binary Numbers

• The “switch” nature of transistors make storing numbers in binary a natural fit.

• Binary uses base 2, as opposed to the decimal numbering system that uses base 10

Page 34: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Example

• Decimal uses digits 0-9 and positions in a number as powers of 10– 73510 = 7*102 + 3*101 + 5*100

• Binary users digits 0,1 and positions in a number as powers of 2– 1012 = 1*22 + 0*21 + 1*20

• We can covert from binary to decimal and vice versa

Page 35: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

35

Representing data

A bit = one binary representation

A Byte = 8 bits

Word = 32 bits

1KB (Kilobyte)= 210 bytes = 1024 bytes

1MB (Megabyte)= 220 bytes = 1,048,576 bytes

1GB (Gigabyte)= 230 bytes=1,073,741,824 bytes

Page 36: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Words

• A word of storage is the basic unit used by a computer.

• A typical computer today is a 32 bit computer, meaning its word size is 32 bits– Today we also have 64-bit machines

• The word size imposes a limit on the memory and the data that can be stored

Page 37: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

37

Word sizes have changed

Page 38: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

38

Physical states representing bits

Page 39: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Representing Data in Binary

• Letters and symbols are encoded as binary numbers• Both ASCII and Unicode are encodings for particular

letters and symbols• ASCII (American Standard Code for Information

Interchange) is used for encoding the English alphabet (http://asciiset.com/ )

• Unicode is used to encode more characters such as those used in Arabic and Asian languages (Unicode)

Page 40: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

Images

• Digital images consist of individual colors in a matrix. • Each individual color is called a pixel.• The color of a pixel is encoded using numbers as well.

Page 41: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

41

Bits <-> information

Representing images:– An image is made up of thousands of very small

dots– These dots are called pixels. – The color of each pixel can be represented as

combination of three colors, Red, Blue, and Green– Each primary color component (R,G,B) can be

represented as an 8-bit byte. An 8-bit string can represent 28 = 256 different things.

Page 42: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

42

Bits <-> information

Representing images:– In this case, the 8-bit string for Red represents

different amounts of Red, from 0 (none) to 255 (lots). The same for Green and Blue.

– If there are 256 different quantities of R, G, and B, then we can mix these together in 256 × 256 × 256 = 16,777,216 ways. It is believed that the human eye can distinguish about 10 million different colors.

Page 43: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

43

Bits <-> information

Page 44: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

44

Networking

A computer network is established when a group of computers is connected to each other for communication. The purpose of this connection or network is to share the resources within the connected units.

You will learn more about networks in EMT2455 & CET4773 The Internet is a network of networks!

What is a computer network?

Page 45: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

45

Computer networks are useful

Page 46: EMT1111 Logic and Problem Solving Lecture 2 Dr. Benito Mendoza

46

Homework Go to: http://openlab.citytech.cuny.edu/emt1111s13/assignments

Complete Lab and Reading Assignments for Week 2