CPSC 110 - Pascal Brent M. Dingle Texas A&M University Chapter 1.

Slides:



Advertisements
Similar presentations
DOS & Windows O/s Prof. Sujata Rao Less 5.
Advertisements

Computer Parts There are many parts that work together to make a computer work.
Parts of a Computer.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Intro to Computers Yoni Fridman 6/28/01 6/28/01.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and 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.
Computer Hardware.
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.
Computer Parts There are many parts that work together to make a computer work.
IC3 GS3 Standard Computing Fundamentals Module
Systems Software Operating Systems.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
The Operating System. Operating Systems (F) What you need to know about –operating system as a program; –directory/folder.
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.
WHAT IS A COMPUTER??? An electronic device that accepts: n Input n Processes the input n Stores the results of the processing n provides Output Computers.
1-1 Introduction to Computer Science Computer Hardware Components: CPU, Memory, and I/O What is the typical configuration of a computer sold today? Minia.
Chapter Introduction to Computers and Programming 1.
Operating Systems What do you have left on your computer after you strip away all of the games and application programs you bought and installed? Name.
By: Dwayne Burl.  The Central Processing Unit (CPU) is responsible for interpreting and executing most of the commands from the computer's hardware and.
Computer Systems Week 10: File Organisation Alma Whitfield.
DOS Understanding what you can do. Operating System Traits An OS only works with one type of processor –X86 processors for us; Motorola for Mac –Must.
INTRODUCTION TO COMPUTER PROGRAMMING itc-314 LECTURE 01.
Topics Introduction Hardware and Software How Computers Store Data
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Computer Parts There are many parts that work together to make a computer work.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Introduction to Computers
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.
Computer Components Checklist There are many parts that work together to make a computer work.
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
CPSC- 120 Principle of Computer Science I Computer = Hardware + Software.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
Introduction to Computer Operation
There are many parts that work together to make a computer work. System Unit Computer Parts.
 There are many parts that work together to make a computer work.
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Hardware/Software Basics Test
Computer Parts There are many parts that work together to make a computer work.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
Digital Literacy: Computer Basics
Operating System. What is Operating System OS is system software, which may be viewed as collection of software consisting of procedures for operating.
Computer Basics Just How Does a Computer Work?
MS-DOS is an acronym for MicroSoft Disk Operating System It is a CUI based operating system. It provides user with a command prompt (generally called.
Computer Parts There are many parts that work together to make a computer work.
Topics Introduction Hardware and Software How Computers Store Data
An Introduction to Computers and Visual Basic
An Introduction to Computers and Visual Basic
Computer Parts There are many parts that work together to make a computer work.
Computer Parts There are many parts that work together to make a computer work.
Computer Parts There are many parts that work together to make a computer work.
08/28/06 parts of the computer.
Computer Parts There are many parts that work together to make a computer work.
Computer Parts There are four main equipment functions of a computer system: Input, Processing, Storage and Output. Input: the transferring of information.
Computers: Hardware and Software
Topics Introduction Hardware and Software How Computers Store Data
Computer Parts There are four main equipment functions of a computer system: Input, Processing, Storage and Output. Input: the transferring of information.
Computer Parts There are many parts that work together to make a computer work.
An Introduction to Computers and Visual Basic
Computer Parts There are many parts that work together to make a computer work.
Computer Parts There are many parts that work together to make a computer work.
Computer Parts There are many parts that work together to make a computer work.
Brent M. Dingle Texas A&M Directory Structure
08/28/06 parts of the computer.
Presentation transcript:

CPSC Pascal Brent M. Dingle Texas A&M University Chapter 1

Here we will present some basic definitions and describe how to use DOS and the Turbo Pascal Environment. We will also look at a little history of Computer Science.

In the beginning… There were rocks and sticks. From that we now have computers. How that came to be will be discussed more in the next Chapter, for now we need to establish some basic skills and definitions.

Program, Software, Hardware A program is a set of instructions for a computer to follow. Software is a collection of programs used by a computer. Hardware is the actual physical machines that make up a computer installation.

Hardware – 5 Components Input devices Output devices CPU (central processing unit) Main memory Secondary memory

Input Devices An input device is any device that allows a person to communicate information to the computer. Mouse, keyboard, microphone, etc.

Output Devices An output device is anything that allows the computer to communicate information to the user. Monitor, printer, speaker, etc. Notice the book refers to monitors as display screens, video display terminals or VDTs. Do NOT confuse output devices with secondary memory !!!

CPU – Central Processing Unit This is where the real ‘brain’ of the computer is. Some examples of CPU’s are the 8086, 486 DX 2, Pentium II, Pentium III, etc. The CPU follows the instructions in a program and performs the necessary calculations.

Main Memory This is where the computer temporarily stores information needed to perform its operations. An example of this is RAM (random access memory). Think of it as ‘scratch paper’ (with each line and page numbered).

Secondary Memory (storage) Secondary memory is used for keeping a permanent record of information after (and before) the computer is used. Such information is stored in files. For example an MS-Word document is saved as a file, a program is saved as a file, a jpeg image is saved as a file, etc.

Secondary Memory (cont) Hard drives, floppy drives, tape drives and Read/Write CD-ROMS would be examples of secondary memory. Secondary Memory is also referred to as Auxiliary Memory or Auxiliary Storage. We will see more about memory later.

Hardware (continued) For most computers the CPU, main memory and secondary memory are placed together in some form of box. The CPU and main memory are generally placed on a motherboard. The secondary memory is now usually the hard disk drive, floppy disk drives and read/write CD-ROMS which ‘plug into’ the motherboard.

Hardware (continued 2) Notice in recent history we have increased the number and quantity of input and output devices – for example speakers and video recording devices. This has led to ‘cards’ being added to the motherboard, which allow the additional devices to be ‘plugged’ into the motherboard.

Software If it’s not hardware, then it’s software. Here we will be looking at: The Operating System Programs Data

Operating Systems You communicate to with the computer through the operating system. An operating system is really a program, but a specially designed one. DOS, Windows, UNIX, and Linux are all Operating systems. DOS stands for Disk Operating System.

Program A program is a set of instructions for the computer to follow.

Data The word data is often used in a variety of contexts. The general meaning of data is any information available to the computer. A more narrow usage of the word is in reference to the input to a program.

Programming Languages High-level languages Low-level languages

High level languages High level languages are designed to be easily read by humans and to make programs easier to write. Some examples are: Pascal, FORTRAN, BASIC, COBOL, C, Modula-2, Scheme and Ada.

High level languages (cont) High level language instructions are usually much more complicated than the CPU can immediately understand, however humans can usually figure them out quickly.

High level languages (cont 2) Most high level languages require a source code file to be created. A source code file is just a text file with a ‘special’ extension. For example the file: hello.pas is probably the source code file for a Pascal program that prints the message “hello.”

Low level languages Low level language instructions are easier for the CPU to understand than for humans to understand. Remember it this way: Computers think at a LOWER level than humans.

Low level languages (cont) An example of a low level language is assembly language. An instruction would look like: ADD X Y Z This would add the contents of memory address X and the contents of memory address Y and store the result at memory address Z. Obviously, right ? =)

Low level languages (cont 2) An even lower level language than assembly is machine language. In this language every instruction is a sequence of ones and zeros. For example the assembly command ADD X Y Z might be: in machine language.

High versus Low The important thing you need to keep straight is that Pascal is a high level language and machine code is a low level language. So you might wonder how the computer understands high level languages…

Compilers For the computer to understand a high level language, such as Pascal, the high level source code must be translated into low level object code by a compiler.

DOS DOS stands for Disk Operating System You should become familiar with some of the DOS commands as YOU WILL BE QUIZZED/TESTED on THEM.

DOS – capital and lowercase DOS is NOT case sensitive – that means it does not care if you use capital or lowercase letters. The filename Howdy.paS, HOWDY.PAS, and howdy.pas are all the same to DOS.

DOS Commands - Format format a: will format the disk in drive a:

DOS Commands – dir dir will display the contents (files and subdirectories) of the current directory. dir a:\ will display the contents of the root directory of drive a: dir a: will display the contents of the current directory of drive a:

DOS Commands – changing drives If the current prompt is: a:\> then the current drive is a: To change to drive c: type: c: and press enter. The prompt will change to: c:\> (assuming the current directory of c is the root directory)

DOS Commands – type type howdy.pas will display the contents of the file named howdy.pas (if it exists in the current directory)

DOS Commands – copy copy oldfile.pas newfile.pas will copy the contents of oldfile.pas into the file newfile.pas (notice newfile.pas may be overwritten)

DOS Commands – CTRL-C Pressing CTRL-C while a DOS program is running should stop the program.

DOS Commands – erase erase dumbfile.pas will erase the file dumbfile.pas from the current directory (assuming it exists). The more common command to do this today is del. For example: del dumfile.pas would also erase the file dumfile.pas from the current directory.

DOS Commands – rename rename badname.pas newname.pas will rename the file badname.pas to newname.pas. The move command does something similar. For example you could also say: move badname.pas newname.pas and achieve the same effect – with some subtle differences.

DOS Commands – diskcopy diskcopy a: b: would copy ALL the contents of the disk in drive a: to the disk in drive b: This of course assumes the two disks are the same ‘size’ (i.e. you could not copy an entire hard drive onto a 3.5” floppy).

DOS Commands – diskcomp diskcomp a: b: will tell you if two disks are identical in content. This is useful after you have done a diskcopy.

DOS Wildcards The asterisk (*) and the question mark (?) act as wildcard characters in DOS. The * represents zero to many characters. The question mark represents 1 character.

DOS Wildcards – usage If you wanted to copy all the files with the.pas extension in the current directory of the c: drive to the a: drive you could type: copy c:*.pas a:

DOS Wildcards – usage If you had the files: bob1.pas, bob2.pas, bob3.pas and bob5.txt and you wanted to copy all 3 of the pascal files to the a: drive you could type copy 3 times, or you could type: copy bob?.pas a:

Directories DOS directories are tree structured, this implies a hierarchical relationship among directories. The top, or main directory, of a drive is the root directory. DOS directories may contain files and/or subdirectories.

DOS – directory commands mkdir (or just md) rmdir (or just rd) cd

DOS Commands – mkdir mkdir newdir creates a new directory named newdir. md newdir also creates a new directory named newdir.

DOS Commands – rmdir rmdir olddir removes the directory named olddir. rd olddir also removes the directory named olddir.

DOS Commands – cd cd prints the current directory path. cd \ takes you to the root directory of the current drive. cd mydir takes you into the subdirectory named mydir

Full Path Name A full path name is a list of directories you would pass through in going from the root directory to the file. If the drive letter is known it IS part of the full path name. (do not be misled by the textbook) The full path name ends with the filename.

Relative Path Name A relative path name is a list of directories to a file relative to the current directory. The relative path name ends with the filename.

Going up directories The directory named “..” is the directory above the current. So to move up a directory type: cd..

Using the Turbo Pascal Environment Please refer to the handout given in class and ATTEND THE LABS ! You will be quizzed/tested on how to use DOS and the Turbo Environment – so be prepared.