Revision Language generations Two’s and One’s Complement and Sign and Magnitude.

Slides:



Advertisements
Similar presentations
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
Advertisements

101.  When you communicate with people you use a language that you both understand.  The trick is that the computer does not speak English.  To communicate.
2 We need programming languages to communicate with a computer. The two broad classifications of programming languages are: Low-level and High- level.
Programming Creating programs that run on your PC
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
Chapter Chapter Goals Describe the layers of a computer system Describe the concept of abstraction and its relationship to computing Describe.
Chapter 1 The Big Picture Chapter Goals Describe the layers of a computer system Describe the concept of abstraction and its relationship to computing.
The Analytical Engine Module 6 Program Translation.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Computers: Tools for an Information Age
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Chapter 1 The Big Picture Chapter Goals Describe the layers of a computer system Describe the concept of abstraction and its relationship to computing.
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
ALGORITHMS AND PROGRAMMING LANGUAGES Lecture 5: Algorithms and programming languages Networks and Communication Department 1.
The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Chapter 1 The Big Picture Chapter Goals Describe the layers of a computer system Describe the concept of abstraction and its relationship to computing.
Chapter 01 Nell Dale & John Lewis.
1 Chapter-01 Introduction to Computers and C++ Programming.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Programming Languages – Coding schemes used to write both systems and application software A programming language is an abstraction mechanism. It enables.
BIT Presentation 6. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
Introduction to Computer Programming itc-314
Binary Representation. Binary Representation for Numbers Assume 4-bit numbers 5 as an integer  as an integer  How? 5.0 as a real number  How?
Number Systems Part 2 Numerical Overflow Right and Left Shifts Storage Methods Subtraction Ranges.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
CHAPTER 1 Overview of Programming and Problem Solving.
Tranlators. Machine Language The lowest-level programming languageprogramming language Machine languages are the only languages understood by computers.languagescomputers.
Programming Language Rico Yu. Levels of Programming Languages 1.Low level languages 2.High level languages.
Chapter 1 The Big Picture.
Programming Languages 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 29, 2004 Lecture Number: 26.
CPS120: Introduction to Computer Science Computer Math: Signed Numbers.
Visual BASIC 1 Introduction
Software – Applications software and programming languages.
The Teacher CP4 Binary and all that… CP4 Revision.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
CSC425 - Introduction To Computer Programming 1. 2 Generation Of Programming Languages A set of rules that telling a computer what to do. There are over.
The Teacher CP4 Binary and all that… CP4 Revision.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
1 Week 1: The History of Computing: Software READING: Chapter 1.2.
Evolution and History of Programming Languages 1.
Liang, Introduction to C++ Programming, (c) Chapter 1 Introduction to Computers, Programs, and C++
Chapter 1 The Big Picture Chapter Goals Describe the layers of a computer system Describe the concept of abstraction and its relationship to computing.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Number Systems Revision of conversations What is a register Addition Complementation.
PROGRAMMING LANGUAGES
Software Development Programming Languages and Data Organization.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
CS 125 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk drive Software.
Branch Addressing op rs rt address address beq $s1, $s2, Label if ($s1 = =$s2) go to Label 6 bits 5 bits 5 bits 16 bits effective 32 bit address.
Introduction to Computer Programming itc-314 Lecture 04.
Lecture-8 Introduction to computer languages.
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
GROUP 2 NAME :  AZMYLL BIN ARSHAD  (18DNS14F2014)  MARYAM JAMILAH BINTI RAHIM  (18ENS14F2004)  SURAYA BINTI MOHAMAD  (18DNS14F2005)  MUHAMMAD SALEH.
CSC141 Introduction to Computer Programming Programming Language.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
High-level language programming paradigms. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
Binary Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:
Advanced Binary b. describe and use two’s complement and sign and magnitude to represent negative integers; c. perform integer binary arithmetic, that.
Introduction to Software
Programming Languages
Operating System Interface between a user and the computer hardware
TRANSLATORS AND IDEs Key Revision Points.
Programming Language Design
صياغة البرامج ولغات البرمجة Programming & programming languages
Computer.
Presentation transcript:

Revision Language generations Two’s and One’s Complement and Sign and Magnitude

Language Generations: Evolution of Programming Languages

First Generation The first generation of languages was very difficult to understand and also to code This language was based on machine code language, hence the programmer would need to use binary For this particular generation, punched tape was used, where a hole would represent a 1 and no-hole meant a 0.

Second Generation / Assembly Language The second generation language, was also based on machine code, This language was much easier as it used mnemonics (short words) Programming was much easier because the programmer did not have to remember a list of binary digits Keywords are used in this language such as ADD, SUB, JMP, MUL, etc

Third Generation / High-level Language The third generation of languages was a very big improvement from the second generation This generation incorporated the use of English-like statements Examples of 3GLs are C, C++, Pascal and JAVA.

Examples of the 3 rd Generations FORTRAN - mathematics formulas, scientific problems, engineering problems COBOL – business oriented BASIC – very easy to understand, ideal to learn programming PASCAL – mostly used for teaching purposes C – used to write operating systems, database management system, scientific applications LISP – artificial intelligence LOGO – teach children problem-solving and programming skills C ++ - An improved C, very popular and powerful JAVA – Very popular and powerful, also cross-platform

Fourth Generation The fourth generation language is a is much closer to the human language A typical example of the ease of use of 4th generation languages is the creation of a GUI. To create a GUI in JAVA would be quite difficult because of the code required for each component, with any 4GL creating an interface is a simple matter of drag and drop This generation is used a lot with databases

Fifth Generation Lastly we have the fifth generation languages, which are the closest to the human language This generation is used in artificial intelligence

Number Systems: Two’s and One’s Complement and Sign and Magnitude

Complementation Complementation is used to represent positive and negative numbers in binary This system requires numbers to be represented by a fixed register size. There are two forms of complementation, one’s complement and two’s complement.

Ones Complement One’s complement is used to represent negative numbers Lets say we have When using 8 bits = If we change to The binary representation changes by converting 0s to 1s and 1s to 0s; after ones complement

Examples DecimalUnsigned Binary One’s Complement DecimalUnsigned Binary One’s Complement

Two’s Complement Two’s complement allows us to perform subtractions with binary numbers With two’s complement we start converting 1s to 0s and 0s to 1s after the first 1 Lets take the previous example of , DecimalUnsigned Binary Two’s complement

Examples DecimalBinaryTwo’s Complement

Sign and Magnitude When we have a fixed register we might want to store our binary number in a certain way The three ways are using; 1. sign and magnitude (first digit is 0 = positive, first digit is1 = negative) 2. one’s complement 3. two’s complement.

Example Lets say I have an 8 bit register and want to store The number changes since it is negative, we first change it to binary = Sign and Magnitude Note that the fist digit is 1 because in this case 14 is a negative number. One’s Complement In this case we simply applied NOT on the binary value of 14. Two’s Complement We change the binary number 14 into two’s complement

Example 2 Lets say I have an 8 bit register and want to store The number does not change since it is a positive number, we first change it to binary = Sign and Magnitude Note that the fist digit is 0 because in this case 14 is a positive number. One’s Complement In this case we simply leave the binary number the same Two’s Complement In this case we simply leave the binary number the same