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

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

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1: Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java

Objectives. Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer?

CMSC 1513 Lecture 1.2

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

Computer Components 1 CSC1103- Nouf AlJaffan Saturday, 02 February 2013

Information Communications Technology (CE-ICT) 6 th Class

Chapter 1 Introduction to Computers, Programs, and Java

AN INTRODUCTION TO THE COMPUTER

Chapter 1 Introduction to Computers, Programs, and Java

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

Computers Are Your Future

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

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

CSC 121 Computers and Scientific Thinking

Machine Architecture and Number Systems

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

Computer Fundamentals

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

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

Chapter Two. Hardware Basics: Inside the Box

Chapter 1 Computer and Programming. By Zerihun Alemayehu

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

Electricity: Voltage. Gate: A signal enters the gate at a certain voltage. The gate performs operations on it, and sends it out was a new signal.

Introduction to Computers. Joslyn A. Smith

What's in a computer?

Terminology, Types of Computers & Computer Hardware

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

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

CMSC131. Hardware and Software. Hardware

CMSC131. Hardware and Software

User. Application program. Interfaces. Operating system. Hardware

Basic Concepts Of Information Technology (IT)

CHAPTER 2: HOW DOES THE COMPUTER REALLY WORK

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

CHAPTER 1 Introduction to Computers and Java

Chapter 1: Introduction to Computers and Programming

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

Introduction to Computers, Programs, and Java. CSE 114, Computer Science 1 Stony Brook University

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

2011 Francisco Delgadillo

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

The Programming Process Summer 2010 Margaret Reid-Miller

Copyright 2006 Prentice-Hall. All rights reserved. 1

Zimmer CSCI /24/18. CHAPTER 1 Overview. COMPUTER Programmable devices that can store, retrieve, and process data.

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

Introducing the Computer

Introduction to Java Programming

Lesson 1: Computer Concepts

Computer Technology Flash Card 2

LECTURE SCHEDULE 2. Units of Memory, Hardware, Software and Classification of Computers

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

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

Lesson 01 Introduction

Chapter 1 Introduction to Computers, Programs, and Java

INTRODUCTION TO COMPUTERS

Introduction. A Look Inside a Laptop Computer. What is inside a laptop computer? What is Inside a Laptop Computer?

Introduction To Computer Hardware. Hafijur Rahman

Computer Overview. A computer item you can physically see or touch. A computer program that tells computer hardware how to operate.

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

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

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

9/7/2012. Introduction. Peeking into Computer Science. Jalal Kawash Mandatory: Chapter 1 Optional: None. Reading Assignment

SCSP Programming Technique C

Programming 1 - Honors

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Lecture 1: Introduction to Java

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

Introduction to computers

Chapter One. Introduction to Computer System

CHAPTER 1: INTRODUCTION TO COMPUTERS AND PROGRAMMING. 1 Muhalim Mohamed Amin Faculty of

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

Defining Computers. Defining Computers. Understanding Essential Computer Concepts

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

Sahalsoftware college. Welcome To understanding Basic Computer Concept

Computer ANAMIKA ACADEMY. Mo Which function has the ability to move from one web page to another Hyper link

Systems Architecture

Introduc)on to Compu)ng. Heng Sovannarith

CHAPTER 1 INTRODUCTION TO COMPUTERS, PROGRAMS, AND JAVA. Objectives

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

System Unit Components Chapter2

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

Chapter 4 The Components of the System Unit

Community Development and Training Centre Semester IT 245 Management Information Systems

Ch. 1: Computer System part I

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

Introduction to Computers and Java

TECHNOLOGY IN ACTION. Chapter 2. Alan Evans * Kendall Martin * Mary Anne Poatsy. Looking at Computers: Understanding the Parts

About the Presentations

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

Parts of the Computer System. Parts of the Computer System. Parts of the Computer System. Essential Computer Hardware. Information Processing Cycle

card slots CPU socket Monitor Computer case houses CPU (Central Processing Unit), CPU central power supply, DVD drive, etc processing unit Keyboard

IB Computer Science Topic.2-

Introduction to Computers and Java

Transcription:

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

What is a Computer? A typical computer consists of: a CPU memory a hard disk a monitor and one or more communication devices. Bus Storage Memory CPU Communication Input Output e.g., Disk, CD, and Tape e.g., Modem, and NIC e.g., Keyboard, Mouse e.g., Monitor, Printer

Communication A phone modem uses a phone line and can transfer data in a speed up to 56,000 bps (bits per second). A DSL (digital subscriber line) also uses a phone line and can transfer data up to 10 Mbps. A cable modem uses the TV cable line maintained by the cable company. Cable modems are usually faster than DSL (30 Mbps). A Network Interface Card (NIC) is a device to connect a computer to a local area network (LAN). For example, a typical type of NIC, called 10BaseT, can transfer data at 10 Mbps (million bits per second). Bus Storage Memory CPU Communication Input Output e.g., Disk, CD, and Tape e.g., Modem, and NIC e.g., Keyboard, Mouse e.g., Monitor, Printer

Memory Memory is a place to store data and program instructions for the CPU to execute. A program and its data must be brought to memory before they can be executed. A memory unit is an ordered sequence of bytes, each or which holds eight bits. Memory is never empty, but its initial content may be meaningless to your program. The current content of a memory byte is lost whenever new information is placed in it. (Think of the whiteboard in this room.) Bus Storage Memory CPU Communication Input Output e.g., Disk, CD, and Tape e.g., Modem, and NIC e.g., Keyboard, Mouse e.g., Monitor, Printer

Bits A computer is really nothing more than a set of switches. Each switch exists in two states: on or off. Storing information is simply a matter of setting a sequence of switches on or off. If a switch is on, we say its value is 1. If a switch is off, its value is 0. A single value of 0 or 1 is called a bit (for binary digit). Data of various kinds, such as numbers, characters, and strings, are encoded as a series of bits (zeros and ones).

Bytes We saw another version of this chart earlier Memory address Memory content The smallest unit of storage a programmer can access is called a byte. A byte consists of 8 bits. A byte is large enough to hold a small number (such as 3) or a single character (such as Q ).... 2000 2001 2002 2003 2004... 01001010 01100001 01110110 01100001 00000011 Encoding for character J Encoding for character a Encoding for character v Encoding for character a Encoding for number 3 If a program needs to store a large number that cannot fit into a single byte, it may be split across a number of adjacent bytes in memory. The way data is encoded within a byte varies depending on whether the data represents a number, a character, or something else. Programmers need not be concerned about the encoding and decoding of data, which is performed automatically by the system based on the encoding scheme.

Large numbers of bytes Since computers have a large capacity of memory, we describe large numbers of bytes using the SI prefixes. A kilobyte is about 1,000 bytes. A megabyte is about 1,000,000 bytes A gigabyte is about 1,000,000,000 bytes. A terabyte is about 1,000,000,000,000 bytes. We use these same prefixes for describing other large numbers, too. Megahertz (MHz) and gigahertz (GHz) are measures of frequency. Megabits per second (Mbps) and gigabits per second (Gbps) are measures of the speed at which data can be transferred.

Storage Memory is volatile, meaning the information contained is lost when the power is off. Programs and data are permanently stored in secondary storage and are moved to memory when the computer actually uses them. There are three main types of storage devices: o o o Disk drives (hard disks and floppy disks) CD drives (CD-R and CD-RW) Tape drives Bus Storage Memory CPU Communication Input Output e.g., Disk, CD, and Tape e.g., Modem, and NIC e.g., Keyboard, Mouse e.g., Monitor, Printer

CPU (Central Processing Unit) the brain of a computer: It retrieves instructions from memory and executes them. CPU speed is measured in gigahertz (GHz): 1 GHz = 1,000,000,000 pulses per second. CPU speed has been improved continuously. Intel Core 2 Quad Processor Q9550: 2.83 GHz. Bus Storage Memory CPU Communication Input Output e.g., Disk, CD, and Tape e.g., Modem, and NIC e.g., Keyboard, Mouse e.g., Monitor, Printer

Structure of a computer and the von Neumann architecture John von Neumann proposed the Stored Program Model in a 1946 paper Program is stored in memory (as well as data) CPU fetches instructions one by one and executes them Secondary storage hard drive, DVD, tape programs Memory data data program instructions Central Processing Unit CPU data Input devices keyboard, mouse, touch screen, network data Output devices printer, plotter, monitor, network

The Fetch-Execute Cycle The Central Processing Unit (CPU) in a computer executes a fetch-execute cycle over and over. Fetch an instruction Execute the instruction Repeat The speed of this cycle is defined by the speed of the processor chip.

Programs and Programming Languages Computer programs, collectively known as software, are simply sets of instructions to the computer. A programmer tells a computer what to do through programs. Without software, a computer is an empty machine. Computers do not understand human languages, so you need to use computer languages to communicate with them. Programs are written using various different programming languages.

Machine Language Machine language is a set of primitive instructions built into every computer. It is the language that that computer s CPU chip speaks. The instructions are in the form of binary code, so you have to enter binary codes for various instructions. Programming in a native machine language is a very tedious process. Moreover, the programs are highly difficult to read and modify. For example: to add two numbers, you might write an instruction in binary that looks like this: 1101000100100011

Assembly Language Assembly languages were developed to make programming easier. Assembly language is a language that is easier for humans to understand than machine language. Computers do not understand assembly language. However, people write programs called assemblers that can convert assembly language programs into machine language. For example, to add two numbers, you might write an instruction in assembly code like this: ADDR R1, R2, R3 This would get translated into the string of 0s and 1s that makes up the machine language instruction. Assembly Source File Machine Code File ADDF3 R1, R2, R3 Assembler 1101000100100011

High-Level Programming Languages High-level programming languages such as Python are even more English-like and easy to learn and program. The following is an example of a high-level language statement that computes the area of a circle with radius 5: area = 5 * 5 * 3.1416 This statement would actually be translated into multiple machine language instructions.

Popular High-Level Languages COBOL (COmmon Business Oriented Language) FORTRAN (FORmula TRANslation) BASIC (Beginner s All-purpose Symbolic Instructional Code) Pascal (named for Blaise Pascal) Ada (named for Ada Lovelace) C (strongly associated with the UNIX operating system) Visual Basic (Basic-like visual language developed by Microsoft) Delphi (Pascal-like visual language developed by Borland) C++ (an object-oriented language, based on C) Java Swift Python

Compilers vs. Interpreters Compilers are programs that take a source file written in a highlevel language, translate them, and produce an object file written in machine language. The object file can then be executed by the computer. High-level Language Source File Compiler Machine Language Object File Execute instructions C, C++, Java are typically compiled languages.

Compilers vs. Interpreters Interpreters are programs that take individual instructions written in a high-level language, translate them, and execute them. You can also accumulate instructions in a file and have the interpreter automatically run them one at a time. High-level Language Statement Interpreter Execute a single instruction Python, Ruby, and Swift are typically interpreted languages.

Interpreters vs. Compilers Interpreter Translates one statement at a time. Takes less time to analyze the source code, but the overall execution time is slower. No intermediate code is generated, so it s memory-efficient. Continues translating the program until the first error is met, in which case it stops. Debugging is typically easier. Compiler Scans the entire program and translates it into machine code. Takes more time to analyze the source code, but the overall execution time is faster. Generates intermediate object code requiring linking, so it requires more memory. Generates error messages only after scanning the entire program. Debugging may be harder.

Operating Systems and Applications An operating system (OS) is the software that manages a computer s basic functions, such as scheduling, running applications, and controlling hardware. Microsoft Windows is currently the most widely used operating system. Apple laptops run MacOS. Many powerful mainframes and workstations run a version of UNIX or Linux. iphones run ios; other phones (such as Samsung) run Android. Users interact with the OS to run programs called applications. Browsers E-mail, messaging, and social networking Productivity tools (word processors, spreadsheets, calendars) Games