Chapter 1. Hardware. Introduction to Computers and Programming. Chapter 1.2

Similar documents
Introduction. Chapter 1. Hardware. Introduction. Creators of Software. Hardware. Introduction to Computers and Programming (Fall 2015, CSUS)

Binary Numbers. The Basics. Base 10 Number. What is a Number? = Binary Number Example. Binary Number Example

Hardware. ( Not so hard really )

Fundamentals of Programming (C)

Fundamentals of Programming

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Introduction to Decision Structures. Boolean & If Statements. Different Types of Decisions. Boolean Logic. Relational Operators

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

3.1. Unit 3. Binary Representation

Unit 3. Analog vs. Digital. Analog vs. Digital ANALOG VS. DIGITAL. Binary Representation

Chapter 2 Bits, Data Types, and Operations

CMSC 313 Lecture 03 Multiple-byte data big-endian vs little-endian sign extension Multiplication and division Floating point formats Character Codes

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

EE 109 Unit 3. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

Lecture (09) x86 programming 8

The Binary Number System

5/17/2009. Digitizing Discrete Information. Ordering Symbols. Analog vs. Digital

Chapter 2 Bits, Data Types, and Operations

Data Representation and Binary Arithmetic. Lecture 2

CS341 *** TURN OFF ALL CELLPHONES *** Practice NAME

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc.

CPS 104 Computer Organization and Programming Lecture-2 : Data representations,

EE 109 Unit 2. Analog vs. Digital. Analog vs. Digital. Binary Representation Systems ANALOG VS. DIGITAL

ASSIGNMENT 5 TIPS AND TRICKS

Chapter 3. Information Representation

Chapter 2 Bits, Data Types, and Operations

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes. Error Detection Codes

Experiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program.

Bits and Bytes. Data Representation. A binary digit or bit has a value of either 0 or 1; these are the values we can store in hardware devices.

Number System (Different Ways To Say How Many) Fall 2016

Chapter 2 Number System

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, SPRING 2013

CSE-1520R Test #1. The exam is closed book, closed notes, and no aids such as calculators, cellphones, etc.

Number Systems II MA1S1. Tristan McLoughlin. November 30, 2013

Computer Basics 1/6/16. Computer Organization. Computer systems consist of hardware and software.

PureScan - ML1. Configuration Guide. Wireless Linear Imager Wireless Laser scanner - 1 -

EE 109 Unit 2. Binary Representation Systems

Chapter 8. Characters and Strings

Number Systems for Computers. Outline of Introduction. Binary, Octal and Hexadecimal numbers. Issues for Binary Representation of Numbers

Chapter 2 Bits, Data Types, and Operations

Connecting UniOP to Datalogic Barcode Readers

Positional Number System

Variables and data types

Source coding and compression

Chapter 2 Bits, Data Types, and Operations

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

Data Representa5on. CSC 2400: Computer Systems. What kinds of data do we need to represent?

User s Manual. Xi3000 Scanner. Table of Contents

Table of Contents Sleep Settings How to Configure the Scanner. 7 Chapter 2 System Setup

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Data Representa5on. CSC 2400: Computer Systems. What kinds of data do we need to represent?

Number Representations

Under the Hood: Data Representation. Computer Science 104 Lecture 2

C H A P T E R 1. Introduction to Computers and Programming

Oberon Data Types. Matteo Corti. December 5, 2001

EXPERIMENT 8: Introduction to Universal Serial Asynchronous Receive Transmit (USART)

FA269 - DIGITAL MEDIA AND CULTURE

EXPERIMENT 7: Introduction to Universal Serial Asynchronous Receive Transmit (USART)

lesson 3 Transforming Data into Information

Xi2000-BT Series Configuration Guide

Digital Representation

Configuration Manual PULSAR C CCD SCANNER. Table of Contents

Chapter 1: Why Program? Computers and Programming. Why Program?

S-Series Sensor ASCII Protocol v8.1.0

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

2D BARCODE SCANNER CA-SC-20200B

2a. Codes and number systems (continued) How to get the binary representation of an integer: special case of application of the inverse Horner scheme

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

What is the typical configuration of a computer sold today? 1-1

Number Systems Base r

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation

Chemistry Hour Exam 2

What is Data Storage?

User. Application program. Interfaces. Operating system. Hardware

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 02, FALL 2012

Unit 3, Lesson 2 Data Types, Arithmetic,Variables, Input, Constants, & Library Functions. Mr. Dave Clausen La Cañada High School

A GUIDE TO RS-232 COMMUNICATION WITH FX PLCS

An Overview of the Computer System. Kafui A. Prebbie 24

Chapter 7. Binary, octal and hexadecimal numbers

Do not start the test until instructed to do so!

marson MT8200S 2D Handheld Scanner User Manual V / 6 / 25 - I -

NC-1200 BARCODE SCANNER. Configuration Guide - 1 -

4/14/2015. Architecture of the World Wide Web. During this session we will discuss: Structure of the World Wide Web

Delivery content * Pocket Barcode scanner x 1 * Mini USB cable x 1 (for charging only) * Quick instructions x 1 * Strap x 1

Setup Procedures 2 Batch Setup 3. Bar Code Setup Menu 5. 1 Device Selection and Default. 2 Beep and Delay Keyboard Wedge..

BARCODE SCANNER. Configuration Guide - 1 -

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

RS-422 Code-Operated Switches

Addmaster Corporation

n NOPn Unary no operation trap U aaa NOP Nonunary no operation trap i

Programmable #182 Parallel Interface Cash Drawer Manual

Pharmacy college.. Assist.Prof. Dr. Abdullah A. Abdullah

Wireless 2D Pocket barcode scanner

Do not start the test until instructed to do so!

Wearable 2D Pocket barcode scanner

Transcription:

Chapter Introduction to Computers and Programming Hardware Chapter.2

Hardware Categories Input Devices Process Devices Output Devices Store Devices /2/27 Sacramento State - CSc A 3 Storage Devices Primary Storage helps run your computer this includes motherboard memory and memory used to run programs Secondary Storage much slower than primary storage allows data to be stored permanently /2/27 Sacramento State - CSc A 4 2

Functions of a Computer Input Data Process Data Output Data Store Data /2/27 Sacramento State - CSc A 5 Functions of a Computer Analog Digital /2/27 Sacramento State - CSc A 6 3

The Processor Chapter.2 The Processor The "Arithmetic Logic Unit" performs calculations & logic The "Control Unit" controls your computer talks to other components talks to ports /2/27 Sacramento State - CSc A 8 4

Example Processors Intel Pentium IBM PowerPC MOS 652... thousands more /2/27 Sacramento State - CSc A 9 Evolution of the Processor Modern processors are small enough to fit in your hand And they contain millions of transistors The size of computers has changed drastically in the last 7 years The first computer was huge by today's standards /2/27 Sacramento State - CSc A 5

ENIAC Computer of War Electronic Numerical Integrator And Computer Development John Eckert and John W. Mauchly U.S. Ballistics Research Laboratory Needed to fight World War II then Cold War Compute ballistic firing tables /2/27 Sacramento State - CSc A ENIAC Computer of War Designed to be Turing Complete Operational in February 946 Features 5 KHz (5 Hz) programmed by rewiring pre 948 based on decimal not binary weighed 3 tons,8 feet high, 8 feet long /2/27 Sacramento State - CSc A 2 6

ENIAC A tube burned out once every 2 days Retired in 955 operational for only 9 years But in just 9 years... it is estimated to have performed more calculations than all of humanity had ever done prior /2/27 Sacramento State - CSc A 3 7

Primary Storage Chapter.2 8

Random Access Memory Random Access Memory (RAM) memory used to run data and programs fast temporary it is gone after the computer is turned off (power is lost) The more memory you have... the more you can open/run at one time stored on DIMM cards that can be added to motherboards /2/27 Sacramento State - CSc A 7 Virtual Memory Used when the system runs out of memory computers with limited RAM can run large programs this is a type of "emergency" memory Uses hard disk space slow... not as fast as RAM "invisible" to application software /2/27 Sacramento State - CSc A 8 9

Secondary Storage Chapter.2 Inside a Hard Disk Read-Write Head /2/27 Sacramento State - CSc A 2

Tape Storage Magnetic Media Long continuous tape sequential access finding data requires seeking Inexpensive lots of storage! often used for backups primarily used in business /2/27 Sacramento State - CSc A 2

Solid State Technology Cards Compact Flash MMC Secure Digital Smart Media USB Flash Drive Plugs into any USB port Acts like a hard drive /2/27 Sacramento State - CSc A 23 Optical Storage Data is read using lasers light spots are called lands dark spots are called pits Safer than magnetic media data not lost over time safe from magnets resists the other elements /2/27 Sacramento State - CSc A 24 2

Current Mediums CD Compact Disk holds 7 MB of data (8 min) DVD Digital Versatile Disk holds about 4.7 GB of data double layer can store 8.5 GB /2/27 Sacramento State - CSc A 25 Current Mediums Blue-ray Named after blue laser used to read/write the data Official acronym is BD holds about 25 GB of data double layer can store 5 GB /2/27 Sacramento State - CSc A 26 3

Binary Numbers Chapter.3 What is a Number? We use the Hindu-Arabic Number System positional grouping system each position represents a power of Binary numbers based on the same system use powers of 2 rather than /2/27 Sacramento State - CSc A 28 4

Base Number The number 783 is... 4 3 2 7 8 3 + 7 + 8 + 3 = 783 /2/27 Sacramento State - CSc A 29 Binary Number Example The number is... 2 7 32 2 6 28 2 5 2 4 2 3 2 2 2 2 64 6 8 4 2 64 + 32 + 8 + = 5 /2/27 Sacramento State - CSc A 3 5

Binary Number Example The number is... 2 7 32 2 6 28 2 5 2 4 2 3 2 2 2 2 64 6 8 4 2 28 + 64 + 6 + 8 + 2 + = 29 /2/27 Sacramento State - CSc A 3 Hexadecimal Numbers Writing out long binary numbers is cumbersome and error prone As a result, computer scientists often write computer numbers in hexadecimal Hexadecimal is base-6 We only have...9 to represent digits So, hexadecimal uses A...F to represent...5 /2/27 Sacramento State - Cook - CSc 35 - Spring 25 32 6

Hexadecimal Numbers Hex Decimal Binary 2 2 3 3 4 4 5 5 6 6 7 7 Hex Decimal Binary 8 8 9 9 A B C 2 D 3 E 4 F 5 /2/27 Sacramento State - Cook - CSc 35 - Spring 25 33 Hex Example The number AC is... 6 3 6 2 6 6 496 256 6 A C ( 256) + ( 6) + 2 = 428 /2/27 Sacramento State - Cook - CSc 35 - Spring 25 34 7

Converting Binary to Hex = Easy Since 6 = 2 4, a single hex character can represent a total of 4 bits Byte can be represented with only 2 hex digits! When looking at raw data, editors, called Hex Editors, display data as groups of 2 hex digits 5 C /2/27 Sacramento State - Cook - CSc 35 - Spring 25 35 Bits and Bytes Everything in a modern computer is stored using combination of ones and zeros Bit is one binary digit either or shorthand for a bit is b Byte is a group of 8 bits e.g. shorthand for a byte is B /2/27 Sacramento State - Cook - CSc 35 - Spring 25 36 8

The Byte Nibble bit /2/27 Sacramento State - Cook - CSc 35 - Spring 25 37 Adding Binary Integers + = 9

Adding Binary Integers Computer's add binary numbers the same way that we do with decimal Columns are aligned, added, and "'s" are carried to the next column In computer processors, this component is called an adder /2/27 Sacramento State - Cook - CSc 35 - Spring 25 39 Adding Base Numbers + 2 3 4 5 7 8 5 4 6 5 9 /2/27 Sacramento State - Cook - CSc 35 - Spring 25 4 2

Adding Binary Example 82 + 5 /2/27 Sacramento State - Cook - CSc 35 - Spring 25 4 Adding Binary Example + 233 /2/27 Sacramento State - Cook - CSc 35 - Spring 25 42 2

How Text Is Stored Chapter.3 Characters Characters and their matching values are a character set There have been many characters sets developed over time /2/27 Sacramento State - CSc A 44 22

Character Sets ASCII 7 bits 28 characters uses a full byte, one bit is not used created in the 967 EBCDIC Alternative system used by old IBM systems Not used much anymore\ /2/27 Sacramento State - CSc A 45 ASCII Chart Control characters 2 3 4 5 6 7 8 9 A B C D E F NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 sp! " # $ % & ' ( ) * +, -. / 3 2 3 4 5 6 7 8 9 : ; < = >? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ \ ] ^ _ 6 ` a b c d e f g h i j k l m n o 7 p q r s t u v w x y z { } ~ DEL /2/27 Sacramento State - CSc A 46 23

ASCII Codes Each character has a unique value The following is how "Moe" is stored in ASCII Binary Decimal M 77 o e /2/27 Sacramento State - CSc A 47 Useful Control Characters 2 3 4 5 6 7 8 9 A B C D E F NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 sp! " # $ % & ' ( ) * +, -. / 3 2 3 4 5 6 7 8 9 : ; < = >? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ \ ] ^ _ 6 ` a b c d e f g h i j k l m n o 7 p q r s t u v w x y z { } ~ DEL /2/27 Sacramento State - CSc A 48 24

Unicode Character Set ASCII is only good for the United States Other languages need additional characters Multiple competing character sets were created Unicode was created to support every spoken language Developed in Mountain View, California /2/27 Sacramento State - CSc A 49 Unicode Character Set Originally used 6 bits that's over 65, characters! includes every character used in the World Expanded to 2 bits 2 million characters! now supports every character ever created Unicode can be stored in different formats /2/27 Sacramento State - CSc A 5 25

How a Program Works Chapter.4 How a Program Works The CPU does all the operations on the computer Each operation is called an instruction The collection of the instructions that be performed on a computer is its instruction set /2/27 Sacramento State - CSc A 52 26

How a Program Works Examples: read a piece of data add two numbers multiply two numbers moving data around comparing two pieces of data etc /2/27 Sacramento State - CSc A 53 How a Program Works Computer programs, just like everything else on a computer, are just 's and 's So, the processor only reads, and "understands", binary These binary instructions are called machine language /2/27 Sacramento State - CSc A 54 27

Fetch-Decode-Execute When a program is executed, the processor needs to perform three tasks These are referred to the Fetch-Decode-Execute cycle /2/27 Sacramento State - CSc A 55 Fetch-Decode-Execute. Fetch read the next machine language instruction from memory 2. Decode Look at the 's and 's and determine what it does 3. Perform the operation /2/27 Sacramento State - CSc A 56 28

Assembler Converts assembly into machine code Each computer instruction is written using a mnemonic a short name for the instruction Programmers have the full power of the processor but have to write programs carefully /2/27 Sacramento State - CSc A 57 Assembler mov $846, %ax add $42, %ax mov $list, %bx, mov $5, %di mov %ax, (bx,di) Assembler /2/27 Sacramento State - CSc A 58 29

High-Level Programming Most programs are written in languages such as C#, Java, Visual Basic, etc These are high-level languages which are written in simple readable text Programs written this way are referred to as source code /2/27 Sacramento State - CSc A 59 Programming Languages Language series of symbols & words that form a meaningful pattern This is true of spoken languages such as English, Spanish, Hindi, Arabic, etc... Programming language used to write programs there many different programming languages /2/27 Sacramento State - CSc A 6 3

Example Programming Languages Ada BASIC FORTRAN COBOL C C++ C# Java JavaScript Python Ruby Visual Basic.NET /2/27 Sacramento State - CSc A 6 Compilers and Interpreters Compilers convert a high-level language directly to assembly or machine code Interpreters looks at a high-level language and executes it immediately using its own code similar to the concept of macros which might have heard about /2/27 Sacramento State - CSc A 62 3

Compilers Compiler a = 846; a += 42; list[5] = a; mov $846, %ax add $42, %ax mov $list, %bx mov $5, %di mov %ax, (bx,di) /2/27 Sacramento State - CSc A 63 Integrated Development Environments Many high-level languages are written in a Integrated Development Environment (also called a Integrated Design Environment) It is a program designed to help the programmer create the program Contains features for debugging, managing, compiling, etc /2/27 Sacramento State - CSc A 64 32

Types of Software Chapter.5 Software Major Categories System Software runs programs & manages data operating System Windows, Mac-OS includes utility programs Application Software works with the user to perform a task example: Microsoft Word, Solitaire /2/27 Sacramento State - CSc A 66 33

What an Operating System Does Master controller for all of the activities that take place within a computer Basic Duties: memory management track resources communicate with devices interact with application software interact with the user /2/27 Sacramento State - CSc A 67 Microsoft Windows The most common operating system on Intel-PCs Major Versions: Windows 95 995 Windows XP 2 Windows 7 2 Windows 8 22 Windows 25 /2/27 Sacramento State - CSc A 68 34

Windows Linux Evolved from UNIX Multiple competing versions Red Hat Ubuntu Android phones etc... Popular for small servers & computer science workstations /2/27 Sacramento State - CSc A 7 35

Ubuntu Linux Apple Mac-OS Created by the Apple Corporation for the Macintosh Major Versions: System 984 System 6 988 System 7 99 Mac-OS X 2 /2/27 Sacramento State - CSc A 72 36

37