Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Overview. Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program.

Similar presentations


Presentation on theme: "Software Overview. Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program."— Presentation transcript:

1 Software Overview

2 Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program (typically software)  Hardware is to structure as software is to function Understanding what we want the computer to do (execute programs) will help us to understand the way the computer is organized

3 It’s all about numbers Ultimately computing concerns numbers and the manipulation thereof Thus instructions have two parts The operand is the data, the actual numbers or some reference to it (an address)  An instruction may have more than one operand The operation or opcode is the action to be performed on the data Procedural programming tends to focus on the actions, while object oriented programming tends to focus on the data

4 Data Types In high level languages, the actions that are allowed and the precise nature of those actions can be determined by the type of data Primitive:  Integer, short, long  real, float, double  character  boolean

5 Data Types (Cont.) Derived Types Arrays Strings Records Files Pointers (references)  Using references minimizes data copying needed, which can be slow and requires a lot of memory (hardware issues). This is an example of a problem with both a software and a hardware solution

6 Hardware issues Memory word size E.g. data types (such as C’s int) can be machine dependent, causing portability problems Bus size If the data is larger than the bus, how is it moved around? Bit manipulation Does hardware allow accessing individual bits? Error checking and error correcting Is parity checking built into the memory?

7 Basic Actions In high level languages, statements typically fit into one of the following categories; they Move data  e.g. read, write, assign Change data  e.g. arithmetic operations, boolean operations Control program flow  e.g. if/then/else, case statement (switch), while, do/for Modularity  e.g. blocks, subroutines, functions,

8 Moving data Hardware issue: data movement can be slow, does the microprocessor have to wait for it to be complete? Bus size Bus speed DMA (direct memory access) Video processor Caching In object-oriented programming, data has structure, what happens to the structure as it is moved around?

9 Changing data Hardware issue: how many different instructions will the computer support Instruction set: The list of instructions supported by the microprocessor Studying software, how many times a given instruction is used, led to changes in hardware More instructions means more circuitry means more expensive  RISC: Reduced Instruction Set Computer  CISC: Complex Instruction Set Computer

10 Controlling flow Studying software issues like “branch prediction” (how often the next step in executing the code is the next step in the written code) has led to changes in how microprocessors are built. How much can be done in “parallel”? Pipelining Parallelization Superscalar Math coprocessor  Separate versus one CPU

11 Parsing To break something written in a language (computer or otherwise) into small parts (tokens) so it can be analyzed. Parsing an English sentence first involves identifying where one word ends and the next begins, then determining if a word is a noun, preposition, etc., and then picking out the subject, verb and so on Part of transition from code understood by humans (source code) to code understood by hardware (machine code) – platform dependence

12 Parsing and Syntax Turning a string of characters into a desired action by the computer requires an underlying set of rules. The set of rules is known as syntax. In English, syntax is the rules governing the spelling of words, their ordering within sentences, and other grammatical rules including punctuation Examples of syntax in high-level languages would be the semi-colon at the end of each statement in C and the reserving of key words

13 Translating Translating (compiling, interpreting) a program is a first step in converting source code to machine code It checks that the basic rules (syntax) have been followed

14 Parsing (Cont.) Parsing can be divided into lexical analysis and semantic parsing. Lexical analysis focuses on dividing strings into pieces, called tokens, using spaces, punctuation and so on. Semantic parsing then tries to determine the string’s meaning.

15 Binary, unary An example of syntax would be whether an operator is binary or unary Binary operators take two operands e.g. the boolean operator AND (x<y) AND (i=j) Unary operator take one operand E.g. the boolean operator NOT NOT(x<y) Some ops are context dependent - 5 (unary) versus 4-5 (binary)

16 Postfix, infix, prefix Another example of syntax is the ordering of opcode and operand(s) Postfix: operand(s) then opcode 4 5 + Works well with stacks (demo in lab) Prefix: opcode then operand(s) + 4 5 Infix: operand opcode operand 4 + 5

17 Stored program concept In the ENIAC, programming was done externally by plugging wires into boards (like switchboard operators of yesteryear) In the next generation of computers, programs were entered into the computer’s memory This is known as “the stored program concept”

18 How a program is stored Data and instructions together Data and instructions separated Stacks


Download ppt "Software Overview. Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program."

Similar presentations


Ads by Google