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

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

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class

Introduction to Computers and Java

Introduction to Computers and Java

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

Introduction to Computers and Java

Introduction to Computers and Java

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

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

CHAPTER 1 Introduction to Computers and Java

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

The Programming Process Summer 2010 Margaret Reid-Miller

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

Chapter 1: Introduction to Computers and Programming

Introduction to Computers and Java

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall

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

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

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

Java and Software Design

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

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

COMP Computer Basics. Yi Hong May 13, 2015

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

ECS15, Lecture 10. Goals of this course 2/8/13. Mini-Review & Topic 3.2 Software. Today s agenda

Chapter 1 Introduction to Computers, Programs, and Java

Intermediate Programming & Design (C++) Notation

Computer Principles and Components 1

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

Getting Started. Chapter 1. Java Programming FROM THE BEGINNING. Chapter 1: Getting Started

Introduction to Computers. Joslyn A. Smith

INTRODUCTION TO COMPUTERS

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

Information Science 1

I1100 E Introduction to computer.

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

User. Application program. Interfaces. Operating system. Hardware

Programming 1 - Honors

Introduction to Java Programming

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

Computers in Engineering COMP 208. Computer Structure. Computer Architecture. Computer Structure Michael A. Hawker

Chapter 1 Introduction to Computers and Programming

A computer is an electronic device, operating under the control of instructions stored in its own memory unit.

Computer Architecture

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components

assembler Machine Code Object Files linker Executable File

15/09/15. Introduction to Computers & The Internet. Contents. Computer hardware and software. Input and output devices CPU. Memory.

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

Computer Systems A Background Review

Switching to AQA from OCR

Introduction to Computers and Programming Languages. CS 180 Sunil Prabhakar Department of Computer Science Purdue University

Chapter 1 Computer and Programming. By Zerihun Alemayehu

Chapter Two. Hardware Basics: Inside the Box

Getting Started with Java. Atul Prakash

Chapter 1. Computer Abstractions and Technology

Chapter 1. Introduction to Computers and Programming. M hiwa ahmad aziz

Computer Fundamentals

IB Computer Science Topic.2-

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

An Introduc+on to Computers and Java CSC 121 Spring 2017 Howard Rosenthal

Computer Software: Introduction

Introduction. Arizona State University 1

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Chapter 1 Introduction to Computers, Programs, and Java

From High Level to Machine Code. Compilation Overview. Computer Programs

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Session 2. >_ {Code4Loop}; Roochir Purani

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

CMSC131. Hardware and Software. Hardware

CMSC131. Hardware and Software

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso

Machine Architecture and Number Systems CMSC104. Von Neumann Machine. Major Computer Components. Schematic Diagram of a Computer. First Computer?

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

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

Coding & Computation or What s all this about 1s and 0s? File: coding-computation-slides.tex.

8. A is approximately one billion bytes a. Kilobyte b. Bit c. Gigabyte d. Megabyte 9. SMPT, FTP and DNS are applications of the layer a. Data link b.

Stonelaw High School. Computing Science. BGE - Computer Systems

Ch. 1: Computer System part I

CSC180: Lecture 2. Wael Aboulsaadat.

CHAPTER 2: HOW DOES THE COMPUTER REALLY WORK

Chapter 1: Introduction to Computers, Programs, and Java

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Computer Architecture 2/26/01 Lecture #

Machine Architecture and Number Systems

Topic Notes: MIPS Instruction Set Architecture

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

Elementary Computing CSC M. Cheng, Computer Science 1

1- What is a computer?

CMSC 1513 Lecture 1.2

Elementary Computing CSC 100. M. Cheng, Computer Science

CSCE150A. Administrivia. Overview. Hardware. Software. Example. Program. Pseudocode. Flowchart. Control Structures. Hello World Program CSCE150A

Why Operating Systems? Topic 3. Operating Systems. Why Operating Systems? Why Operating Systems?

Computer Science & Engineering 150A Problem Solving Using Computers

Intentionally Blank 0

Homeschool Enrichment. The System Unit: Processing & Memory

Transcription:

Hardware and Software Computer Basics TOPICS Computer Organization Data Representation Program Execution Computer Languages Computer systems consist of hardware and software. Hardware includes the tangible parts of computer systems. Software includes programs - sets of instructions for the computer to follow. Familiarity with hardware basics helps us understand software. 1 2 Computer Organization Hardware The majority of modern computers have similar components including: Input devices (keyboard, mouse, etc.) Output devices (display screen, printer, etc.) Central Processing Unit (CPU) or processor Main and auxiliary (secondary) memory 3 4 1

Computer Architecture Processors The processor is also called the CPU (Central Processing Unit) Processes a relatively simple set of instructions. Programs must be translated into the specific instruction set. The power of computing comes from speed and program intricacy. 5 6 Main memory Auxiliary Memory Working memory used to store set of instructions for current program data the program is using results of intermediate calculations Now measured in gigabytes e.g. 8 gigabytes of RAM RAM is short for random access memory A byte is a quantity of memory Also called secondary memory Disk drives, optical drives (CD/DVD), flash drives, etc. More or less permanent (nonvolatile) Usually measured in gigabytes e.g. 512 gigabyte hard drive 7 8 2

Data Representation n Computers store data as binary numbers, not decimal! n Numbers can be used to represent almost any type of data: n Characters (e.g. a ) are represented by numbers n Strings (e.g. foo ) are just groups of characters n Pictures are represented by dividing them into picture elements known as pixels n Video images or animations are represented by placing several pictures one after another n Sounds are represented by sampling the pressure wave at regular intervals 9 Bits, Bytes and Words n Bit: 0 or 1 n Byte: sequence of eight bits: 00101110 n Word: sequence of 2, 4 or 8 bytes n To computer, everything is a sequence of bits! n If we have 4 bits, how many things can we represent? 10 Main Memory Figure 1.1 Bit Permutations 1 bit 0 1 2 bits 00 01 10 11 3 bits 000 001 010 011 100 101 110 111 0000 0001 0010 0011 0100 0101 0110 0111 4 bits 1000 1001 1010 1011 1100 1101 1110 1111 Each additional bit doubles the number of possible permutations. 11 12 3

Bit Permutations Positional Representation n Each permutation can represent a particular item n There are 2 N permutations of N bits n N bits are needed to represent 2 N unique items How many items can be represented by 1 bit? 2 bits? 3 bits? 4 bits? 2 1 = 2 items 2 2 = 4 items 2 3 = 8 items 2 4 = 16 items 5 bits? 2 5 = 32 items How many items can be represented by 8 bits? 16 bits? 32 bits? 64 bits? n Decimal number representation: n What does 256 mean? 2 * 100 + 5 * 10 + 6 2 * 10 2 + 5 * 10 1 + 6 * 10 0 n Binary number representation: n What does 10010 mean? 1 * 2 4 + 0 * 2 3 + 0 * 2 2 + 1 * 2 1 + 0 * 2 0 16 + 0 + 0 + 2 + 0 = 18 n Let s count 0 to 15 in binary. n Add 1 each time, carry just like in base 10 13 14 Text Representation ASCII n Remember to a computer everything is binary n Need to convert from characters (what is on a keyboard) to bit representation n ASCII: 7 bit mapping in one byte, n each character maps to different value n A decimal digit is also a character and has a mapping, e.g., 0 is 00110000 (48 in decimal). 15 16 4

Pixels Pixels n Everything is stored as 0 s and 1 s n Pictures are reduced to rectangles, or pixels 17 18 Animation Sound/Audio 19 20 5

Analog to Digital Conversion Files 21 Large groups of bytes in auxiliary memory are called files. Files have names and extensions, managed by operating system. Files are organized into groups called directories or folders. Java programs are stored in files. Program files are copied from auxiliary to main memory before running. 22 The Operating System Computer Languages The operating system is a supervisory program that: oversees the operation of the computer controls resources such as disk drives retrieves and starts program for you Well-known operating systems: Microsoft Windows, Apple Mac OS, Linux, and UNIX. n Low-Level Languages n Machine Code n Assembly Code n High-Level Languages n Fortran n COBOL, BASIC n Pascal, C, n C++, Java n Perl, Python n R, Matlab n Interpretation versus Compilation n Visual Languages 23 24 6

Programming Languages Compilers High-level languages are relatively easy to use for the programmer: Java, C#, C++, Python, Ruby, etc. Low-level languages are very complex and error prone, but computers don t understand high-level languages! High-level language programs must be translated into low-level languages. A compiler translates a program from a high-level language to a low-level language that the computer can run. You compile a program by running the compiler on the source code of the high-level program. Compilers produce machine or assembly-language programs called object programs. 25 26 Java Byte-Code Java Byte-Code The Java compiler doesn t translate a Java program into assembly or machine language for a particular computer. Instead, it translates a Java program into byte-code. Byte-code is the machine language for a hypothetical computer (or interpreter) called the Java Virtual Machine. A byte-code program is easy to translate into machine language for any particular computer, this can be done on-the-fly. A program called an interpreter translates each byte-code instruction, executing the resulting machinelanguage. 27 28 7

Compiling, Interpreting, Running Portability Use the compiler to translate the Java program into byte-code (done using the javac command). Use the Java virtual machine for your computer to translate each byte-code instruction into machine language. Eclipse tool makes all this very easy! After compiling a Java program into byte-code, the byte-code can be used on any computer with a byte-code interpreter without recompiling. Byte-code can be sent over the Internet and used anywhere in the world, this makes Java highly portable and thus suitable for Internet applications. 29 30 Running a Program Running a program another view 1. First the program and all its data are copied from the hard disk into main memory 2. The CPU goes to the location of the program instruction and reads that word 3. The CPU determines what action is requested by decoding its bit pattern representation 4. The CPU performs the action 5. The CPU then moves to the location of the next program instruction in memory, reads the word, and repeats the process word in 31 32 8

Instruction Execution Model Instructions n CPU n Instruction cycle n Fetch instruction from main memory n Decode instruction n Fetch operands n Execute instruction n Store operands n Determine the next instruction to execute n Format: <operation, operand, operand> n Operations n Arithmetic & logical n Data movement n Control n Operands: locations of data and instructions n Examples: n Add reg1 reg2 n Move reg1 010010100101001010010100 n Goto 110101110101110101110101 33 34 9