Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
15 views

01 Introduction To Computers and Programming Repetition

This document provides an introduction to computers and programming concepts. It discusses how computers store data using sequences of 0s and 1s in bytes made up of bits. It also explains how decimal numbers are represented in binary, and how characters are stored using character coding schemes like ASCII and Unicode. The document concludes with an overview of key concepts in programming like high-level languages, keywords, operators, and syntax.

Uploaded by

adedapo adedire
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

01 Introduction To Computers and Programming Repetition

This document provides an introduction to computers and programming concepts. It discusses how computers store data using sequences of 0s and 1s in bytes made up of bits. It also explains how decimal numbers are represented in binary, and how characters are stored using character coding schemes like ASCII and Unicode. The document concludes with an overview of key concepts in programming like high-level languages, keywords, operators, and syntax.

Uploaded by

adedapo adedire
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Introduction to Computers and Programming (Short


Repetition)
Introduction
• Computers can be programmed
– Designed to do any job that a program tells them to
• Program: set of instructions that a computer follows to perform a task
– Commonly referred to as Software
• Programmer: person who can design, create, and test computer programs
– Also known as software developer

1
How Computers Store Data
• All data in a computer is stored in sequences of 0s and 1s
• Byte: just enough memory to store letter or small number
– Divided into eight bits
– Bit: electrical component that can hold positive or negative charge, like on/off switch
– The on/off pattern of bits in a byte represents data stored in the byte

2
Counting

Decimal Binary Calculation


0 0000 0 ∗ 20
1 0001 1 ∗ 20
2 0010 1 ∗ 21 + 0 ∗ 20
3 0011 1 ∗ 21 + 1 ∗ 20
4 0100 1 ∗ 23 + 0 ∗ 21 + 0 ∗ 20
5 0101 1 ∗ 23 + 0 ∗ 21 + 1 ∗ 20
6 0110 1 ∗ 23 + 1 ∗ 21 + 0 ∗ 20
7 0111 1 ∗ 23 + 1 ∗ 21 + 1 ∗ 20
8 1000 1 ∗ 24 + 0 ∗ 23 + 0 ∗ 21 + 0 ∗ 20

0001 is the same as 1, the leading zeros are a convention

3
Storing Characters - Character Sets
• Data stored in computer must be stored as binary number
• Characters are converted to numeric code, numeric code stored in memory
– Most important coding scheme is ASCII
∗ ASCII is limited: defines codes for only 128 characters
– Unicode coding scheme becoming standard
∗ Compatible with ASCII
∗ Can represent characters for other languages

High-Level Languages
• Low-level language: close in nature to machine language
– Example: assembly language
• High-Level language: allows simple creation of powerful and complex programs
– No need to know how CPU works or write large number of instructions
– More intuitive to understand

4
Key Words, Operators, and Syntax: an Overview
• Key words: predefined words used to write program in high-level language
– Each key word has specific meaning
• Operators: perform operations on data
– Example Addition +
∗ 12 + 12
– Example Assignment =
∗ magic_number = 42
• Syntax: set of rules to be followed when writing program
• Statement: individual instruction used in high-level language

You might also like