1 / 17

CISC 110 Day 1

CISC 110 Day 1. Hardware, Algorithms, and Programming. Outline. Structure of Digital Computers Programming Concepts Output Statements Variables and Assignment Statements Data Types String and Numeric Operations. Structure of Digital Computers. I/O Devices

Télécharger la présentation

CISC 110 Day 1

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. CISC 110Day 1 Hardware, Algorithms, and Programming

  2. Outline • Structure of Digital Computers • Programming Concepts • Output Statements • Variables and Assignment Statements • Data Types • String and Numeric Operations

  3. Structure of Digital Computers I/O Devices Input/Output Devices: (e.g. Keyboard, Mouse, Webcam) Communication between the computer and the user, and with other computers Main Memory RAM (Random Access Memory): Short-term memory of data and programs, while computer is powered on CPU (Central Processing Unit): Calculations and the Fetch-Execute Cycle Secondary Storage Long-term memory of data and programs (e.g. hard drive)

  4. Main Memory (RAM) byte 3021 11110000 10101100 11011010 00110101 01000001 10101010 01011101 00000000 11111111 11100010 10110101 00011011 01001111 2 byte memory location at address 3021: could hold a 16-bit integer byte 3022 byte 3023 byte 3024 4 byte memory location at address 3024: could hold a 32-bit integer byte 3025 byte 3026 byte 3027 byte 3028 byte 3029 1 byte memory location at address 3030: could hold one letter byte 3030 byte 3031 byte 3032 byte 3033

  5. Memory Sizes Memory Conversion 1 bit Either 1 or 0 1 nybble 4 bits 1 byte 8 bits 1 kilobyte 210 bytes (approx. 1000 bytes) 1 megabyte 220 bytes (approx. 1000 kilobytes) 1 gigabyte 230 bytes (approx. 1000 megabytes) 1 terabyte 240 bytes (approx. 1000 gigabytes)

  6. Computers: A Definition Computers are machines that can carry out routine mental tasks by performing simple operations at high speeds (operations built into the hardware: machine operations).

  7. A Definition of an Algorithm An algorithm is a sequence of instructions that describes how to carry out a task.

  8. A Mathematically Precise Definition of an Algorithm An algorithmis a finite sequence of unambiguous, executable instructions for carrying out a task or processin a finite amount of time. Note: This assumes no intelligence on the part of the user. The intelligence and knowledge of a person is encoded in the algorithm.

  9. A Definition of a Programming Language A programming language consists of a repertoire of possible instructions, each of which can be specified in terms of the simple operations (machine operations) a computer can execute.

  10. Cake-making & Computation Bit String: Numbers or Characters Cake Ingredients (Input) Program/Software Recipe (Algorithm) Electronic Computer Oven & Utensils (Hardware) Bit String: Numbers or Characters Cake (Output)

  11. A Definition of a Scripting Language A scripting language is a programming language that allows control of an application, for instance an animation. The name script is derived from the written script of the performing arts, which tells the actors what to say.

  12. ActionScript Trace() Purpose: To display values in the output panel to trace the state of an animation Examples: trace( 525 ); trace ( “Now starting love scene” ); trace ( “Row ” + 5 + “Col ” + 7 ); trace ( 5 + 7 ); trace ( “5 + 7 = ” + 5 + 7 );

  13. Defining Variables to Store Values ActionScript: Memory: var row = 5; row = 8; var next = row + 1; next = next + 1; var s = “hi”; var val = 3.5; row next s val

  14. Data Typing Variables ActionScript: var row: int = 5; row = 8; var next: int = row + 1; next = next + 1; var s: String = “hi”; var val: Number = 3.5;

  15. Operators: +Concatenation +=Append Escape Sequences: \nNew Line \tTab \’ Single Quote \” Double Quote \\ Backslash String Operations Examples: trace( “Hey” + “you” ); trace( “Hey\nyou” ); trace( “Hey\tyou” ); trace( “Hey\”you\”” );

  16. Operators: +Addition -Subtraction *Multiplication /Integer Division %Mod (integer remainder of division) Arithmetic Operations

  17. Imperative Programming Statements: Variable Assignment (=) Branching (if, else) Loops (while, for) Data Structures: Integers Strings Arrays Classes Functions 17

More Related