1 / 10

High Level Languages

High Level Languages. Why don’t Computers understand English?. Complexity of human language Size of vocabulary Flexibility of grammar E.g. Word order Ambiguity Figures of Speech Metaphors Similes Etc. So what is their language?. Machine Code Binary 0 and 1

orenda
Download Presentation

High Level Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. High Level Languages

  2. Why don’t Computers understand English? • Complexity of human language • Size of vocabulary • Flexibility of grammar • E.g. Word order • Ambiguity • Figures of Speech • Metaphors • Similes • Etc.

  3. So what is their language? • Machine Code • Binary 0 and 1 • Impossible for humans to understand • Lots of tiny steps to do one task • Controls working of the computer • Low level language 010101111101010101010101010111111

  4. How to control computers? • They can’t understand English • We can’t understand Machine Code • Need an “in-between” language • High Level Languages • Assembly Code

  5. High Level Languages • Similar to English • PRINT, FOR…STEP…NEXT, DO… LOOP etc • Easy to learn / write / edit • Designed to solve problems • Different types • Need translating to Machine Code

  6. HLLs - Examples • BASIC • Beginners’ All-purpose Symbolic Instruction Code • COBOL • Common Business Oriented Language • PROLOG • Programming with Logic

  7. Translation • All HLLs need translated into machine code • Interpreted Languages • Line at a time • Compiled Languages • All done in one go at the start

  8. Compiled Languages • E.g. C++ • Won’t run at all if there’s a syntax (grammar) error anywhere • E.g. missing colon, FOR without NEXT etc. • Guaranteed grammatically correct when it runs • Runs fast once translated

  9. Interpreted Languages • E.g. Visual Basic • Points out errors at implementation stage • Will run until an error is found • May take ages to find an error • Slower to run • Each instruction translated as required • Wasteful of time in loops

  10. Assembly Code • Sometimes HLLs aren’t what’s needed • Low level – nearer Machine Code • Translated to M/Code by Assembler • Control computer SUB ESP, LOCALDATASPACE ; make space for local data FLD [ESP].SMAP.A ; load a FSTP [ESP].SMAP.CALLPARM1 ; store a on top of stack CALL _sin ; _sin reads parameter CALLPARM1 FSTP [ESP].SMAP.X ; store x

More Related