Topic 1: Introduction to Computers and Programming

Slides:



Advertisements
Similar presentations
Chapter 1 An Overview of Computers and Programming Languages.
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
Overview of Computers & Programming Languages Chapter 1.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Chapter 1: An Overview of Computers and Programming Languages
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
CS102 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Chapter 1 An Overview of Computers and Programming Languages.
Topics Introduction Hardware and Software How Computers Store Data
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
Chapter Two Hardware Basics: Inside the Box. ©1999 Addison Wesley Longman2.2 Chapter Outline What Computers Do A Bit About Bits The Computer’s Core: CPU.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CISC105 General Computer Science Class 1 – 6/5/2006.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
What is a Computer? An, electrical machine, that can be programmed to accept data (input), process it into useful information (output) and store it away.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
What is a computer? Computer is a device for processing information.
Computer Architecture
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Computer Organization. The digital computer is a digital system that performs various computational tasks Digital computer use binary number system which.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Computer Programming (1) Code & No.: CS 102 CREDIT HOURS: 5 UNIT Lecture 3.0 hours/week Lab: 2.0 hour/on every week a. This course introduces the students.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Chapter 1 An Overview of Computers and Programming Languages.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming
BASIC PROGRAMMING C SCP1103 (02)
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: An Overview of Computers and Programming Languages
BASIC PROGRAMMING C SCP1103 (02)
Overview of Computers and Programming Chapter 1
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Introduction
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Overview of Computers & Programming Languages
Chapter 1: Introduction to Computers and Programming
Computer Science I CSC 135.
Topics Introduction Hardware and Software How Computers Store Data
Overview of Computer Architecture and Organization
ICS103 Programming in C 1: Overview of Computers And Programming
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Topic 1: Introduction to Computers and Programming “A journey of a thousand miles must begin with a single step.” - Lao Tzu

Introduction to Computer Organization Computers are composed of two distinct components: Hardware – the equipment used to perform computations. This includes the CPU, memory, hard disk, etc… Software – the programs that determine the operations to be performed by the hardware. CISC 105 – Topic 1

Hardware Components Hardware consists of many types of components: Primary Storage Secondary Storage The Central Processing Unit (CPU) Input Devices Output Devices CISC 105 – Topic 1

Primary Storage and Secondary Storage There are two primary types of storage in a computer: Primary Storage – often referred to as main memory, or just memory. This storage is very quickly accessed by the various hardware components. Secondary Storage – includes such devices as a hard disk, floppy disk, CD-ROM, DVD-ROM, etc… CISC 105 – Topic 1

Memory Organization Computer memory is organized into memory cells. Each cell has a unique address, which allows the accessing of each cell individually. Programs are transferred from secondary storage into primary storage before they can be run. CISC 105 – Topic 1

The Central Processing Unit (CPU) The CPU is responsible for coordinating all computer operations and performing the operations specified in a program. The CPU fetches an instruction from a program loaded in memory, decodes the instruction, retrieves necessary data, performs the operation, and then saves the result. The CPU contains very high speed memory cells termed registers, which holds the data being operated on. CISC 105 – Topic 1

Input and Output Devices Input devices are used to communicate from some external source to the computer. They include the keyboard and the mouse. Output devices are used to communicate from the computer to some external source. They include the monitor and the printer. CISC 105 – Topic 1

Computer Software All major computers run an operating system. An operating system is a special type of program which controls the interaction between all hardware components and the user. CISC 105 – Topic 1

Operating Systems Tasks Responsibilities of the OS include: Communicating with the user(s) Managing resources including memory and processor time among programs Collecting data from input devices Providing data to output devices Accessing data from secondary storage Writing data to secondary storage CISC 105 – Topic 1

Binary Math A binary digit or bit for short is the smallest unit of computer information. Just as our familiar decimal number system has 10 digits,(0,1,2,3,4,5,6,7,8,9) the binary number system has only 2 digits (0,1). This is the perfect number system for computers since we can store a binary digit by making an electrical or magnetic field either on or off, positive or negative, 1 or 0. In the decimal system we can count 10 (we start counting with 0) items with one decimal place, 100 with two decimal places, 1000 with three decimal places and so on. CISC 105 – Topic 1

Binary Math The binary number system works the same way except since we only have 0s and1s our base is 2. So we can count 2 permutations of 1 bit: 0 1 4 permutations of 2 bits: 00 01 10 11 8 permutations of 3 bits: 000 001 010 011 100 101 110 111 16 permutations of 4 bits: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 ...and so on. CISC 105 – Topic 1

Binary Math So in an eight bit byte, the numbers are represented this way: Bit: - - - - - - - - Value: 128 64 32 16 8 4 2 1 Example: 1 0 1 1 0 1 1 0 Values: 128 + 0 + 32 +16 + 0 + 4 + 2 + 0 = 182 The minimum number is 0 (all 0s) and the maximum number is 255 (all 1s), so you can represent 256 numbers (0-255) with one byte. CISC 105 – Topic 1

Computer Programming - Machine Language Computer programs were originally written in machine language. Machine language is a sequence of binary numbers, each number being an instruction. Each instruction is computer-understandable. 00000000 00010101 00010110 CISC 105 – Topic 1

Computer Programming - Assembly Language To make machine language more abstract, assembly language was introduced. Assembly language provides a one-to-one mapping between a machine instruction and a simple human-readable instruction. CLR A ADD A ADD B 00000000 00010101 00010110 CISC 105 – Topic 1

Computer Programming – Assembly Language Assembly language is converted to computer-understandable machine language by an assembler. Although assembly language is much more clear and understandable than machine language, it is still very difficult to program. The assembly code for the sqrt() function in C is composed of hundreds of assembly instructions. CISC 105 – Topic 1

Computer Programming – High-Level Languages In order to get around these obstacles, high-level languages were introduced. High-level languages provide a one-to-many mapping between one high-level statement and multiple assembly language instructions. High-level language is converted to assembly instructions by a compiler. CISC 105 – Topic 1

Computer Programming - Compilation A = 6 X 3 MOV EAX, 0 // initialize EAX to 0 MOV EBX, 3 // set multiplicand LABEL1: ADD EAX, 6 // multiplier DEC EBX // decrease count JNZ LABEL1 // loop if need to STOR A, EAX // store result in A CISC 105 – Topic 1

Modern Software Development Modern software development is done in high-level languages, with few exceptions. High-level language is first compiled from source code to assembly and then assembler into machine code. Modern compilers perform the assembler function as well. Compiled source code is called an object file. CISC 105 – Topic 1

Modern Software Development Programmers often use library functions, which are pre-written functions provided as part of the compiler/development toolset. A library is an object file. After the source code is compiled into machine code, a linker resolves cross-references among these object files, including libraries. The object files are linked into an executable file. CISC 105 – Topic 1

Modern Software Development The executable file can now be run. The operating system loader loads the executable file into memory and schedules the program for execution. CISC 105 – Topic 1

Modern Software Development Compiler Source Code File Object File Other Object Files (perhaps libraries) Linker Executable File Loader CISC 105 – Topic 1

The Software Development Method Specify the problem. Analyze the problem. Design an algorithm to solve the problem. Implement the algorithm. Test and verify the program. Maintain and update the program. CISC 105 – Topic 1

Review Name the principle components of a computer. What are three responsibilities of the operating system? What advantage does assembly language have over machine language? What advantages do high-level languages have over assembly language? CISC 105 – Topic 1

Review What computer program translates a source code file into an object file? What program combines object files and produces an executable file? What part of the operating system is responsible for the loading and scheduling of programs? What are the steps in the software development method? CISC 105 – Topic 1