This document provides an introduction and overview of computers and programming languages. It discusses the basic components of a computer system, including the CPU, memory, and input/output devices. It also covers low-level machine languages that hardware understands versus high-level languages that are easier for humans, like Python. Programs must be compiled or interpreted to run. The document demonstrates using the Python interactive shell and basic functions like print.
This document provides an introduction to computers and C++ programming, covering the following topics in 3 sentences or less:
It introduces computer systems including hardware components like processors, memory, and I/O devices. It then discusses computer architecture, programming languages, and how high-level languages are compiled and linked before execution. The document concludes with an overview of algorithm design, the software development lifecycle, the structure of a basic C++ program, and debugging techniques.
This document provides an overview of computer hardware, software, data storage, and the programming process. It discusses how computers work by accepting data as input, processing it, and producing output based on instructions from programs. The major hardware components are the CPU, memory, storage devices, and input/output mechanisms. Software includes operating systems and applications. Data is stored in computers as binary digits or bits that represent numbers and other information. The programming process involves understanding problems, planning logic, coding, testing, and implementation.
Introduction to Computer Software, Classification of Computer Software, Computer BIOS, Operating System, Utility Software, Compiler and Interpreter, Linker and Loader, Application Software, Programming Languages
This document provides an overview of different types of software, including system software and application software. It defines software and describes system software such as operating systems, device drivers, firmware, translators, and utility software. It also defines application software and describes types including commercial software, customized software, and freeware. Specific examples are provided for each type of software discussed.
Programming Fundamentals and Programming Languages Conceptsimtiazalijoono
Programming Fundamentals:
What is a Computer?
Software & Hardware?
Operating System
Programming Languages Concepts
Why do we need programming languages?
Why C Still Useful?
This document provides an introduction to programming languages and Python. It discusses what a program is, different categories of software, and types of programming languages including machine language, assembly language, and high-level languages. It also covers programming paradigms like imperative, logical, functional, and object-oriented. The document outlines the software development life cycle and describes key areas where Python is commonly used like academia, scientific tools, machine learning, and web development.
This document provides an introduction to computer programming. It discusses what a computer program and programming language are, and describes the major classes of programs as application programs and operating systems. It explains the process a programmer goes through to write code using a text editor and translating the source code into machine language. The document also outlines the basic components of a computer and describes different types of programming languages like high-level languages. Finally, it provides a simple example of a basic C program that converts weight from pounds to kilograms.
Software programs are sets of instructions that must be translated into machine code before the CPU can execute them. The CPU performs basic functions like arithmetic, data movement, and decision making to carry out more complex tasks as specified by software programs. It executes programs through a fetch-decode-execute cycle, fetching instructions from memory based on the program counter before decoding and carrying out each one.
This document provides an introduction to computers and C++ programming, covering the following topics in 3 sentences or less:
It introduces computer systems including hardware components like processors, memory, and I/O devices. It then discusses computer architecture, programming languages, and how high-level languages are compiled and linked before execution. The document concludes with an overview of algorithm design, the software development lifecycle, the structure of a basic C++ program, and debugging techniques.
This document provides an overview of computer hardware, software, data storage, and the programming process. It discusses how computers work by accepting data as input, processing it, and producing output based on instructions from programs. The major hardware components are the CPU, memory, storage devices, and input/output mechanisms. Software includes operating systems and applications. Data is stored in computers as binary digits or bits that represent numbers and other information. The programming process involves understanding problems, planning logic, coding, testing, and implementation.
Introduction to Computer Software, Classification of Computer Software, Computer BIOS, Operating System, Utility Software, Compiler and Interpreter, Linker and Loader, Application Software, Programming Languages
This document provides an overview of different types of software, including system software and application software. It defines software and describes system software such as operating systems, device drivers, firmware, translators, and utility software. It also defines application software and describes types including commercial software, customized software, and freeware. Specific examples are provided for each type of software discussed.
Programming Fundamentals and Programming Languages Conceptsimtiazalijoono
Programming Fundamentals:
What is a Computer?
Software & Hardware?
Operating System
Programming Languages Concepts
Why do we need programming languages?
Why C Still Useful?
This document provides an introduction to programming languages and Python. It discusses what a program is, different categories of software, and types of programming languages including machine language, assembly language, and high-level languages. It also covers programming paradigms like imperative, logical, functional, and object-oriented. The document outlines the software development life cycle and describes key areas where Python is commonly used like academia, scientific tools, machine learning, and web development.
This document provides an introduction to computer programming. It discusses what a computer program and programming language are, and describes the major classes of programs as application programs and operating systems. It explains the process a programmer goes through to write code using a text editor and translating the source code into machine language. The document also outlines the basic components of a computer and describes different types of programming languages like high-level languages. Finally, it provides a simple example of a basic C program that converts weight from pounds to kilograms.
Software programs are sets of instructions that must be translated into machine code before the CPU can execute them. The CPU performs basic functions like arithmetic, data movement, and decision making to carry out more complex tasks as specified by software programs. It executes programs through a fetch-decode-execute cycle, fetching instructions from memory based on the program counter before decoding and carrying out each one.
introduction computer programming languages BakhatAli3
The document provides an overview of computer programming concepts including:
1) It describes the layers of a computer system from the hardware interface to system software to application programs.
2) It explains different types of computer languages from machine language to assembly language to high-level languages and how compilers and interpreters are used to run programs.
3) It discusses key programming concepts like syntax, semantics, grammars, compilation, linking, execution, and different types of errors that can occur in programs.
DISCLAIMER: This Presentation is made for educational purposes only.
Introduction to Computer Programming, Computer Language, History of Computer Language, Hierarchy of High-Level Languages, Algorithm, Data Types and Arduino
Low level, High level and Middle level programming languages
,Bug and Debugging ,difference between compiler and interpreter,instructions and program,source code and object code ,language translators
Computer programming involves writing instructions for a computer in a specific programming language. It is the process of creating computer software. There are many programming languages that are used for different purposes. Programming languages have evolved from low-level machine languages that are difficult for humans to read to high-level languages that are easier to use. High-level languages must be translated into machine code before a computer can execute them. Computer programs use logic, variables, and other programming elements to perform tasks. Programming provides benefits such as meeting demand for software and developing important job skills.
Computer programming involves writing instructions for a computer in a particular programming language. It is done by writing source code which is then translated by compilers, interpreters or assemblers into object code that computers can understand. There are many programming languages at different levels, with high-level languages being easier for humans but slower for computers compared to machine-level languages. Popular high-level languages include Java, Python and C++, which allow programmers to focus on solving problems without worrying about the specific computer hardware.
Slides introduce hardware and software components of Computer System and it also discusses generations of Programming language and Programming language translators. It will be Useful for 1st Engineering students of all disciplines.
Computer programming involves writing instructions for a computer in a programming language. It is done through programming languages that have specific syntax and keywords. There are low-level languages like machine code and assembly that are closer to what computers can understand directly, and high-level languages that are easier for humans like Python and Java but need to be compiled into machine code. Programs are made up of objects, variables, operations and control flow statements. Programming provides benefits like developing problem-solving skills and is a lucrative career.
This lecture introduces programming fundamentals and Python. It discusses what programming is, the process of translating source code into machine-readable instructions, and program design using pseudocode and flowcharts. Program design tools like pseudocode and flowcharts allow programmers to plan programs' logic and structure before writing the actual code. The lecture also provides an overview of Python syntax and variables.
This document discusses compilers and their role in translating programs from high-level languages to machine-level languages. It covers the following key points in 3 sentences:
Compilers translate programs written in high-level languages like C++ and Java into machine-level languages understood by computers. They perform various phases like lexical analysis, syntax analysis, semantic analysis, code generation, and optimization to translate and check the source code. Compilers allow software to be written in readable high-level languages and then executed on different machine architectures through the translation to machine-level code.
This document provides an overview of computer software and related concepts. It discusses the different types of software, including application software, system software, and the software hierarchy. It also describes system programming and various system programs like assemblers, linkers, compilers, and operating systems. Additionally, it covers machine structure, interfaces, address spaces, computer languages at different levels, and tools used for software development.
This document provides an overview of programming paradigms and languages. It discusses batch programs which run without user interaction and process input data. It also discusses event-driven programs which respond to events like user clicks or system updates. The document lists many programming languages throughout history from machine language to modern languages like Java and C#. It defines programming languages and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses language translators like compilers, interpreters, and assemblers that convert languages to machine code.
This document provides an introduction to programming concepts such as algorithms, pseudocode, and flowcharts. It defines computer programming as the process of writing code to instruct a computer, and explains that programming languages allow users to communicate instructions to computers. The document outlines different types of computer languages including low-level languages like machine language and assembly language, and high-level languages like procedural, functional, and object-oriented languages. It also discusses specialized languages, translator programs, and program logic design tools for solving problems algorithmically through pseudocode and flowcharts.
This document discusses different programming paradigms and languages. It describes batch programs which run without user interaction and event-driven programs which respond to user events. It lists many popular programming languages from Machine Language to Java and C#, and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses language translators like compilers, interpreters, and assemblers and how they convert code between languages. Finally, it covers testing, debugging, and different types of errors in code like syntax, semantic, and run-time errors.
This document discusses different programming paradigms and languages. It describes batch programs which run without user interaction and event-driven programs which respond to user events. It lists many popular programming languages from Machine Language to Java and C#, and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses the different types of language translators like compilers, interpreters, and assemblers and how they convert code between languages. Finally, it covers testing, debugging, and different types of errors in programming.
Embedded c c++ programming fundamentals masterHossam Hassan
This document provides an overview of embedded C/C++ programming fundamentals. It discusses what embedded systems and microcontrollers are. It also discusses typical development tools and processes like compilers, linkers, and debugging. Several programming languages are discussed at different levels like machine code, assembly language, and high-level languages like C/C++. C/C++ are recommended for embedded programming due to efficiency and ability to access I/O while assembly is used for speed-critical code. The document also outlines basic C/C++ programming concepts like program structure with directives, declarations, and statements.
This document provides an introduction to computer programming. It discusses what a computer program and programming language are, and describes the two major classes of programs - application programs and operating systems. It explains the process a programmer goes through to write a program, including using a text editor to create source code files and translating it into machine-readable object code. It also gives an overview of the basic components of a computer and different types of memory. Finally, it provides examples of common programming languages and the basic structure of a simple C program.
The document provides information on different types of computer software and programming concepts. It discusses system software and application software, giving examples of each. It also covers programming languages from machine language to assembly language to high-level languages. Other topics summarized include algorithms, flowcharts, pseudocode, decision tables, operating systems, and functions of an operating system.
Computer programming involves writing instructions, known as source code, in a programming language to allow computers to perform tasks. There are different types of programming languages, including low-level machine languages that use 1s and 0s and high-level languages that are closer to English. When writing code in a high-level language, programmers use compilers or interpreters to translate the code into machine language that CPUs can understand. The CPU then executes programs by repeating a fetch-decode-execute cycle to read and carry out each instruction.
1. Assembly language is a low-level programming language that is closer to machine language. It uses mnemonics and symbolic codes to represent instructions, registers, and memory locations that correspond to the underlying machine language of a CPU.
2. Assembly language must be translated into machine-readable machine code by an assembler program before a computer can execute an assembly language program. It provides a level of abstraction over pure machine language.
3. Registers are high-speed storage areas within the CPU that are used to quickly store and retrieve data and instructions being actively used so the CPU does not have to access slower main memory as frequently. This optimization of using registers improves processing speed.
introduction computer programming languages BakhatAli3
The document provides an overview of computer programming concepts including:
1) It describes the layers of a computer system from the hardware interface to system software to application programs.
2) It explains different types of computer languages from machine language to assembly language to high-level languages and how compilers and interpreters are used to run programs.
3) It discusses key programming concepts like syntax, semantics, grammars, compilation, linking, execution, and different types of errors that can occur in programs.
DISCLAIMER: This Presentation is made for educational purposes only.
Introduction to Computer Programming, Computer Language, History of Computer Language, Hierarchy of High-Level Languages, Algorithm, Data Types and Arduino
Low level, High level and Middle level programming languages
,Bug and Debugging ,difference between compiler and interpreter,instructions and program,source code and object code ,language translators
Computer programming involves writing instructions for a computer in a specific programming language. It is the process of creating computer software. There are many programming languages that are used for different purposes. Programming languages have evolved from low-level machine languages that are difficult for humans to read to high-level languages that are easier to use. High-level languages must be translated into machine code before a computer can execute them. Computer programs use logic, variables, and other programming elements to perform tasks. Programming provides benefits such as meeting demand for software and developing important job skills.
Computer programming involves writing instructions for a computer in a particular programming language. It is done by writing source code which is then translated by compilers, interpreters or assemblers into object code that computers can understand. There are many programming languages at different levels, with high-level languages being easier for humans but slower for computers compared to machine-level languages. Popular high-level languages include Java, Python and C++, which allow programmers to focus on solving problems without worrying about the specific computer hardware.
Slides introduce hardware and software components of Computer System and it also discusses generations of Programming language and Programming language translators. It will be Useful for 1st Engineering students of all disciplines.
Computer programming involves writing instructions for a computer in a programming language. It is done through programming languages that have specific syntax and keywords. There are low-level languages like machine code and assembly that are closer to what computers can understand directly, and high-level languages that are easier for humans like Python and Java but need to be compiled into machine code. Programs are made up of objects, variables, operations and control flow statements. Programming provides benefits like developing problem-solving skills and is a lucrative career.
This lecture introduces programming fundamentals and Python. It discusses what programming is, the process of translating source code into machine-readable instructions, and program design using pseudocode and flowcharts. Program design tools like pseudocode and flowcharts allow programmers to plan programs' logic and structure before writing the actual code. The lecture also provides an overview of Python syntax and variables.
This document discusses compilers and their role in translating programs from high-level languages to machine-level languages. It covers the following key points in 3 sentences:
Compilers translate programs written in high-level languages like C++ and Java into machine-level languages understood by computers. They perform various phases like lexical analysis, syntax analysis, semantic analysis, code generation, and optimization to translate and check the source code. Compilers allow software to be written in readable high-level languages and then executed on different machine architectures through the translation to machine-level code.
This document provides an overview of computer software and related concepts. It discusses the different types of software, including application software, system software, and the software hierarchy. It also describes system programming and various system programs like assemblers, linkers, compilers, and operating systems. Additionally, it covers machine structure, interfaces, address spaces, computer languages at different levels, and tools used for software development.
This document provides an overview of programming paradigms and languages. It discusses batch programs which run without user interaction and process input data. It also discusses event-driven programs which respond to events like user clicks or system updates. The document lists many programming languages throughout history from machine language to modern languages like Java and C#. It defines programming languages and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses language translators like compilers, interpreters, and assemblers that convert languages to machine code.
This document provides an introduction to programming concepts such as algorithms, pseudocode, and flowcharts. It defines computer programming as the process of writing code to instruct a computer, and explains that programming languages allow users to communicate instructions to computers. The document outlines different types of computer languages including low-level languages like machine language and assembly language, and high-level languages like procedural, functional, and object-oriented languages. It also discusses specialized languages, translator programs, and program logic design tools for solving problems algorithmically through pseudocode and flowcharts.
This document discusses different programming paradigms and languages. It describes batch programs which run without user interaction and event-driven programs which respond to user events. It lists many popular programming languages from Machine Language to Java and C#, and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses language translators like compilers, interpreters, and assemblers and how they convert code between languages. Finally, it covers testing, debugging, and different types of errors in code like syntax, semantic, and run-time errors.
This document discusses different programming paradigms and languages. It describes batch programs which run without user interaction and event-driven programs which respond to user events. It lists many popular programming languages from Machine Language to Java and C#, and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses the different types of language translators like compilers, interpreters, and assemblers and how they convert code between languages. Finally, it covers testing, debugging, and different types of errors in programming.
Embedded c c++ programming fundamentals masterHossam Hassan
This document provides an overview of embedded C/C++ programming fundamentals. It discusses what embedded systems and microcontrollers are. It also discusses typical development tools and processes like compilers, linkers, and debugging. Several programming languages are discussed at different levels like machine code, assembly language, and high-level languages like C/C++. C/C++ are recommended for embedded programming due to efficiency and ability to access I/O while assembly is used for speed-critical code. The document also outlines basic C/C++ programming concepts like program structure with directives, declarations, and statements.
This document provides an introduction to computer programming. It discusses what a computer program and programming language are, and describes the two major classes of programs - application programs and operating systems. It explains the process a programmer goes through to write a program, including using a text editor to create source code files and translating it into machine-readable object code. It also gives an overview of the basic components of a computer and different types of memory. Finally, it provides examples of common programming languages and the basic structure of a simple C program.
The document provides information on different types of computer software and programming concepts. It discusses system software and application software, giving examples of each. It also covers programming languages from machine language to assembly language to high-level languages. Other topics summarized include algorithms, flowcharts, pseudocode, decision tables, operating systems, and functions of an operating system.
Computer programming involves writing instructions, known as source code, in a programming language to allow computers to perform tasks. There are different types of programming languages, including low-level machine languages that use 1s and 0s and high-level languages that are closer to English. When writing code in a high-level language, programmers use compilers or interpreters to translate the code into machine language that CPUs can understand. The CPU then executes programs by repeating a fetch-decode-execute cycle to read and carry out each instruction.
1. Assembly language is a low-level programming language that is closer to machine language. It uses mnemonics and symbolic codes to represent instructions, registers, and memory locations that correspond to the underlying machine language of a CPU.
2. Assembly language must be translated into machine-readable machine code by an assembler program before a computer can execute an assembly language program. It provides a level of abstraction over pure machine language.
3. Registers are high-speed storage areas within the CPU that are used to quickly store and retrieve data and instructions being actively used so the CPU does not have to access slower main memory as frequently. This optimization of using registers improves processing speed.
Similar to Introduction to computers and programming languages (20)
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
2. Today…
• Introduction (~70 minutes):
• Motivation
• Hardware basics
• High-level vs. low-level programming languages
• Compiling vs. interpreting high-level languages
• Writing very simple Python commands using the interactive mode
• Adminstrivia (~10 minutes):
• Course overview
3. Computers and Programming
• A computer is just a machine (the hardware) for executing programs
(the software)
• Hence, the software rules the hardware!
• The process of creating software is called programming, and it is the
focus of this course
• Virtually, anyone can learn how to program computers
• It requires only some grit!
4. Why Learn Programming?
• Computers have become commonplace in our modern life
• Understanding the strengths and limitations of computers requires some
understanding of programming
• Programming can be loads of fun!
• It is an intellectually engaging activity that allows you to express yourself
through remarkably beautiful creations
• Programming develops valuable problem-solving skills, especially
ones that pertain to analysis, design and implementation
• Programmers are in great demand!
Gene
Sequencing and
Biotechnology
Smaller, Faster,
Cheaper Sensors
Astronomy
Ubiquitous
Computing
5. Why Learn Programming?
• Computers have become commonplace in our modern life
• Applying ideas in different fields requires programming
• Programming can be loads of fun!
• It is an intellectually engaging activity that allows you to express yourself
through remarkably beautiful constructs and structures
• Programming develops valuable problem-solving skills, especially
ones that pertain to analysis, design and implementation
• Programmers are in great demand!
6. Hardware Basics
• To be a successful programmer, you need to know some details of
how computers work
• For instance, understanding the basics of hardware will help you
analyze the performance (or efficiency) of any of your programs
• Will the data of your program fit in memory?
• If not, how would that impact the performance of your program?
• Is your program CPU-bound or IO-Bound?
• If CPU-bound, how powerful is your CPU?
• If IO-bound, how big is your disk or network bandwidth?
7. Functional View of a Computer
Input
Devices
CPU
Main
Memory
Output
Devices
Secondary
Memory
8. Functional View of a Computer
E.g., Hard Disk
• The secondary memory is where your saved program and data reside
• It is a non-volatile storage
• I.e., when the power is turned off,
your program and data will NOT be lost
Secondary
Memory
9. Functional View of a Computer
Main
Memory
Secondary
Memory
E.g., Random Access Memory (RAM)
• The main memory is much faster (but more expensive) than the
secondary one, however, it is volatile
• Your program and data are copied from secondary memory to main
memory for efficiency reasons
10. Functional View of a Computer
CPU
Main
Memory
Secondary
Memory
• The Central Processing Unit (CPU) is the “brain” of the computer
• It can at least perform:
• Arithmetic operations
(e.g., adding 2 numbers)
• Logical operations
(e.g., test if 2 numbers
are equal)
• It can directly access
information stored in main memory but not in secondary memory
11. Functional View of a Computer
Input
Devices
CPU
Main
Memory
Output
Devices
Secondary
Memory
E.g., Monitor
E.g., Keyboard
and mouse
12. Functional View of a Computer
Input
Devices
Output
Devices
E.g., Keyboard
and mouse
E.g., Monitor
Humans interact with computers
via Input and Output (IO) devices
Information from Input devices
are processed by the CPU and
may be shuffled off to the main
or secondary memory
When information need to be
displayed, the CPU sends them to
one or more Output devices
13. Programming Languages
• A program is just a sequence of instructions telling the computer
what to do
• Obviously, we need to provide these instructions in a language that
computers can understand
• We refer to this kind of a language as a programming language
• Python, Java, C and C++ are examples of programming languages
• Every structure in a programming language has an exact form (i.e.,
syntax) and a precise meaning (i.e., semantic)
14. Machine Languages
• Python, Java, C, and C++ are, indeed, examples of high-level languages
• Strictly speaking, computer hardware can only understand a very low-
level language known as machine language
• If you want a computer to add two numbers, the instructions that the
CPU will carry out might be something like this:
Load the number from memory location 2001 into the CPU
Load the number from memory location 2002 into the CPU
Add the two numbers in the CPU
Store the result into location 2003
A Lot of
Work!
15. High-Level to Low-Level Languages
• In a high-level language like Python, the addition of two numbers can
be expressed more naturally:
• But, we need a way to translate the high-level language into a
machine language that a computer can execute
• To this end, high-level language can either be compiled or interpreted
c = a + b Much Easier!
16. Compiling a High-Level Language
• A compiler is a complex software that takes a program written in a
high-level language and translates it into an equivalent program in
the machine language of some computer
Source Code
(Program)
Compiler
Machine
Code
Running
Program
Inputs Outputs
17. Interpreting a High-Level Language
• An interpreter is a software that analyzes and executes the source
code instruction-by-instruction (on-the-fly) as necessary
• E.g., Python is an interpreted language
Source Code
(Program)
Computer
Running An
Interpreter
Inputs
Outputs
18. Compiling vs. Interpreting
• Compiling is a static (i.e., pre-execution), one-shot translation
• Once a program is compiled, it may be run over and over again without
further need for the compiler or the source code
• Interpreting is dynamic (i.e., happens during execution)
• The interpreter and the source code are needed every time the program runs
• Compiled programs tend to be faster, while interpreted ones lend
themselves to a more flexible programming environments (they can
be developed and run interactively)
19. Note on Portability
• The translation process highlights another advantage that high-level
languages have over machine languages, namely, portability
• A program for an Intel-based machine will not run on an IBM-based
machine since each computer type has its own machine language
• On the other hand, a program written in a high-level language (say, a
Python program) can be run on many different kinds of computers as
long as there is a suitable compiler or interpreter
• Python programs are said to be portable!
20. Writing Python Commands
• You can start the Python interpreter in an interactive mode and type
in some commands to see what happens
• When you first start the interpreter program, you may see something
like the following:
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 19 2015, 20:38:52)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
A Python prompt indicating that the Python interpreter is waiting for you to give it a command
21. • Here is a sample interaction with the Python interpreter:
print is a built-in function that
allows displaying information
on screen
When you call the print function,
the parameters in the parentheses
tell the function what to print
There is only 1 parameter passed to
print here, which is a textual data (or what is referred to as a string)
>>> print("Hello")
Hello
>>> print("Programming is fun!")
Programming is fun!
>>> print(3)
3
>>> print(2.3)
2.3
Writing Python Commands
22. >>> print("Hello")
Hello
>>> print("Programming is fun!")
Programming is fun!
>>> print(3)
3
>>> print(2.3)
2.3
• Here is a sample interaction with the Python interpreter:
Writing Python Commands
Another string parameter
An integer (int for short) parameter
A float parameter
How can we figure out in a program whether a value is an int, float, or string?
23. >>> type("Hello")
<class 'str'>
>>> type("Programming is fun!")
<class 'str'>
>>> type(3)
<class 'int'>
>>> type(2.3)
<class 'float'>
The Type Function
• Python provides a special function called type, which allows us to
figure out the data type of any value
24. Summary
• A computer is a universal information-processing machine, which can
carry out any process that can be described in sufficient detail
• A description of the sequence of steps for solving a particular
problem is called an algorithm
• Algorithms can be turned into software (programs) that determine
what the hardware (physical machine) can and does accomplish
• The process of creating software is called programming
25. Summary
• A basic functional view of a computer system comprises a central
processing unit (CPU), a main memory, a secondary memory, and
input and output devices
• The CPU is the brain of the computer that performs simple arithmetic
and logical operations
• Information that the CPU acts on (data and programs) are stored in
main memory (e.g., RAM), while more permanent information are
stored in secondary memory (e.g., disk)
26. Summary
• Programs are written using a formal notation known as a
programming language
• There are many different languages, but all share the property of
having a precise syntax (form) and semantics (meaning)
• Computer hardware only understands a very low-level language
known as machine language
• Programs are usually written using human-oriented high-level
languages such as Python
27. Summary
• A high-level language must either be compiled or interpreted in order
for the computer to understand it
• High-level languages are more portable than machine languages
• Python is an interpreted language
• One way to learn about Python is to use an interactive shell for
experimentation
28. Next Lecture…
• Basic elements of Python programs (e.g., names, expressions, input
statements, output statements, assignment statements, etc.,)