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

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

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

Hardware. ( Not so hard really )

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

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

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

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

3.1. Unit 3. Binary Representation

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

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

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

Fundamentals of Programming (C)

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

Fundamentals of Programming

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

Chapter 2 Bits, Data Types, and Operations

lesson 3 Transforming Data into Information

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

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

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

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

Lecture (09) x86 programming 8

The Binary Number System

Data Representation and Binary Arithmetic. Lecture 2

Chapter 2 Bits, Data Types, and Operations

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

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

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

Memory Study Material

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

Chapter 1: Introduction to Computers and Programming

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

FA269 - DIGITAL MEDIA AND CULTURE

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

What is Data Storage?

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

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

Chapter 2 Bits, Data Types, and Operations

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

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

Source coding and compression

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

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

ASSIGNMENT 5 TIPS AND TRICKS

Chapter 3. Information Representation

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

EE 109 Unit 2. Binary Representation Systems

CHAPTER 1 Introduction to Computers and Java

The Programming Process Summer 2010 Margaret Reid-Miller

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

General Computing Concepts. Coding and Representation. General Computing Concepts. Computing Concepts: Review

Chapter 2 Bits, Data Types, and Operations

Parts are adapted from Windows 98 by Mark Twain Media, Inc. A Computer System has Hardware and Software

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

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Chapter 2 Number System

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

User. Application program. Interfaces. Operating system. Hardware

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

1.1 Bits and Bit Patterns. Boolean Operations. Figure 2.1 CPU and main memory connected via a bus. CS11102 Introduction to Computer Science

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.

Computer is an electronic machine that can receive, store, transform and output data of all kinds (image, text, numeric, graphics and sound).

Chapter 8. Characters and Strings

Chapter 2 Bits, Data Types, and Operations

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

Introduction to Computers

HARDWARE. There are a number of factors that effect the speed of the processor. Explain how these factors affect the speed of the computer s CPU.

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

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

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

Connecting UniOP to Datalogic Barcode Readers

Computer Principles and Components 1

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

Digital Representation

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

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

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

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

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

Variables and data types

CMSC131. Hardware and Software. Hardware

CMSC131. Hardware and Software

Introduction. Arizona State University 1

Computer Organization

Introduction to Computers. Joslyn A. Smith

vinodsrivastava.wordpress.com

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

The Modern Computer. Exploring Computer Science

Positional Number System

User s Manual. Xi3000 Scanner. Table of Contents

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

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

TODAY AND TOMORROW. Storage CHAPTER

This is great when speed is important and relatively few words are necessary, but Max would be a terrible language for writing a text editor.

Oberon Data Types. Matteo Corti. December 5, 2001

Chapter One. Introduction to Computer System

Components of a personal computer

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

Computers Are Your Future

Transcription:

Chapter Introduction Introduction to Computers and Programming (Fall 25, CSUS) Chapter. Introduction Creators of Software Computers perform any job that their programs tell them to do A program is a set of instructions that a computer follows to perform a task. Programs are commonly referred to as software Programmers (a.k.a. Software Developers) are the individuals that create programs They have the training and skills to design, create, and test computer programs 3 4 Hardware Chapter.2 Hardware The term hardware refers to any physical device that a computer is made of Computers are, in fact, large systems that consists of different devices that work together 6

Hardware Categories Input Devices Input Devices Process Devices Output Devices Store Devices Convert analog to digital data Input - feed information into a computer Words and symbols Numbers Pictures Common forms of input Keyboard Mouse 7 8 Process Devices Output Devices Computers can analyze and create data Basic Terms: Process - actions used to manipulate data Processor - device that processes data Common forms Pentium Processor various other chips and hardware Convert digital data to analog Output send information out of a computer Common forms of output Monitor Printers Music and Sound using speakers 9 Storage Devices Storage Devices Copy data for later use The data is kept in digital form Common Forms: Memory CD ROM Hard Disk Flash Disks 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 2

Functions of a Computer Functions of a Computer Input Data Process Data Analog Digital Output Data Store Data 3 4 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 6 Example Processors Evolution of the Processor Intel Pentium IBM PowerPC MOS 652... thousands more 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 7 8 3

ENIAC Computer of War 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 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 9 2 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 Primary Storage Chapter.2 4

Random Access Memory Virtual 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 25 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 26 Hard Disks Chapter.2 Secondary Storage Use magnets to store data Hard disk platter flat, rigid, maintainable disk used to store bits there are multiple platters in each hard drive Head crash the read-write head hits into a dust particle or other contaminant on the disk head crash damages some data on disk 28 Inside a Hard Disk Tape Storage Read-Write Head Magnetic Media Long continuous tape sequential access finding data requires seeking Inexpensive lots of storage! often used for backups primarily used in business 29 3 5

Solid State Storage Data is stored on a low-power chip Advantages non-volatile (stored when power is lost) portable versatile used from digital cameras to computers 32 Solid State Technology Optical Storage Cards Compact Flash MMC Secure Digital Smart Media USB Flash Drive Plugs into any USB port Acts like a hard drive 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 33 34 Current Mediums 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 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 35 36 6

What is a Number? Chapter.3 Binary Numbers 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 38 Base Number Binary Number Example The number 783 is... 4 3 2 7 8 + 7 + 8 + 3 = 783 3 The number is... 2 7 2 6 2 5 2 4 2 3 2 2 2 2 28 64 32 6 8 4 2 64 + 32 + 8 + = 5 39 4 Binary Number Example Hexadecimal Numbers The number is... 2 7 2 6 2 5 2 4 2 3 2 2 2 2 28 64 32 6 8 4 2 28 + 64 + 6 + 8 + 2 + = 29 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 4 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 42 7

Hexadecimal Numbers Hex Example 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 The number AC is... 6 3 6 2 6 496 256 6 A ( 256) + ( 6) + 2 = 428 6 C 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 43 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 44 Converting Binary to Hex = Easy Bits and Bytes 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 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 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 45 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 46 The Byte Nibble Adding Binary Integers bit + = 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 47 8

Adding Binary Integers Adding Base Numbers 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 3 4 5 7 8 6 5 5 4 9 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 49 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 5 Adding Binary Example Adding Binary Example 82 + + 5 233 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 5 9/4/25 Sacramento State - Cook - CSc 35 - Spring 25 52 How Text Is Stored Chapter.3 How Text Is Stored Computer often store and transmit textual data Examples: punctuation numerals 9 letter Each of these symbols is called a character and are the basis for written communication 54 9

Characters Characters Processors rarely know what a "character" is, and instead store each as an integer In this case, each character is given a unique value The letter "A", for instance, could have the value of, "B" is 2, etc Characters and their matching values are a character set There have been many characters sets developed over time 55 56 Character Sets ASCII Chart Control characters 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 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 57 58 ASCII Codes Useful Control Characters 2 3 4 5 6 7 8 9 A B C D E F Each character has a unique value The following is how "Moe" is stored in ASCII Binary Decimal M 77 o e 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 59 6

Unicode Character Set 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 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 6 62 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 64 How a Program Works 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 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 65 66

Fetch-Decode-Execute Fetch-Decode-Execute When a program is executed, the processor needs to perform three tasks These are referred to the Fetch-Decode-Execute cycle. 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 67 68 Assembler 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 mov $846, %ax add $42, %ax mov $list, %bx, mov $5, %di mov %ax, (bx,di) Assembler 69 7 High-Level Programming Programming Languages 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 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 7 72 2

Example Programming Languages Compilers and Interpreters Ada BASIC FORTRAN COBOL C C++ C# Java JavaScript Python Ruby Visual Basic.NET 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 73 74 Compilers Integrated Development Environments a = 846; a += 42; list[5] = a; Compiler mov $846, %ax add $42, %ax mov $list, %bx mov $5, %di mov %ax, (bx,di) 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 75 76 Software Major Categories Chapter.5 Types of Software 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 78 3

What an Operating System Does Microsoft Windows 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 The most common operating system on Intel-PCs Major Versions: Windows 95 995 Windows XP 2 Windows 7 2 Windows 8 22 Windows 25 79 8 Linux Windows Evolved from UNIX Multiple competing versions Red Hat Ubuntu Android phones etc... Popular for small servers & computer science workstations 82 Apple Mac-OS Ubuntu Linux Created by the Apple Corporation for the Macintosh Major Versions: System 984 System 6 988 System 7 99 Mac-OS X 2 84 4

5