Representing Characters

Slides:



Advertisements
Similar presentations
Using Binary Coding Information Remember  Bit = 0 or 1, Binary Digit  Byte = the number of bits used to represent letters, numbers and special characters.
Advertisements

Using Binary Coding Information Remember  Bit = 0 or 1, Binary Digit  Byte = the number of bits used to represent letters, numbers and special characters.
Data Representation in Computers
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Bits and Bytes.
Representing Information in Binary (Continued)
ASCII and Unicode. ASCII Inside a computer, EVERYTHING is a number – that includes music, sound, and text. In the early days of computers, every manufacturer.
Lesson Objectives Explain the use of binary codes to represent characters Explain the term “Character set” Describe with examples (for examples ASCII and.
CODING SYSTEMS CODING SYSTEMS CODING SYSTEMS. CHARACTERS CHARACTERS digits: 0 – 9 (numeric characters) letters: alphabetic characters punctuation marks:
2.1.4 BINARY ASCII CHARACTER SETS A451: COMPUTER SYSTEMS AND PROGRAMMING.
Decisions in Python Comparing Strings – ASCII History.
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Representing text Each of different symbol on the text (alphabet letter) is assigned a unique bit patterns the text is then representing as.
Week 4 Number Systems.
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
Agenda Data Representation – Characters Encoding Schemes ASCII
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
MAC OS – Unit A Page: 10-11, Investigating Data Processing Understanding Memory.
Computer Structure & Architecture 7c - Data Representation.
07/10/ Strings ASCII& Processing Strings with the Functions - Locate (Instr), Mid, Length (Len), Char (ChrW) & ASCII (Asc)
Skill Area 311 Part A. Lecture Overview Binary Numbers Binary Arithmetic ASCII Code Machine Code Instruction Format Advantages and disadvantages of machine.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
CS151 Introduction to Digital Design
Globalisation & Computer systems Week 5/6 Character representation ACII and code pages UNICODE.
Data Representation Conversion 24/04/2017.
Representing Characters in a computer Pressing a key on the computer a code is generated that the computer can convert into a symbol for displaying or.
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
The character data type char. Character type char is used to represent alpha-numerical information (characters) inside the computer uses 2 bytes of memory.
Agenda Character representation Numerical Conversions ASCII EBCDIC
M204 - Data Representation
Representing Characters in a Computer System Representation of Data in Computer Systems.
The ASCII Alphanumeric Code What is it? Why use it? How do we use it?
Understanding Computers
THE CODING SYSTEM FOR REPRESENTING DATA IN COMPUTER.
DATA Unit 2 Topic 2. Different Types of Data ASCII code: ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
1.4 Representation of data in computer systems Character.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
DATA REPRESENTATION - TEXT
Binary Representation in Text
Binary Representation in Text
Understanding binary Understanding Computers.
Unit 2.6 Data Representation Lesson 2 ‒ Characters
Binary 1 Basic conversions.
INTERNATIONALIZATION
Binary Numbers and ASCII and EDCDIC
INFS 211: Introduction to Information Technology
3.1 Denary, Binary and Hexadecimal Number Systems
Data Transfer ASCII FILES.
Guide To UNIX Using Linux Third Edition
Breaking the Code Can anyone guess the phrase from this “code”?
Data Encoding Characters.
Data Representation ASCII.
Data Representation Question: Characters
Computers & Programming Languages
Ch2: Data Representation
Data Representation Conversion 05/12/2018.
Information Representation
4.1 Strings ASCII & Processing Strings with the Functions
Learning Intention I will learn how computers store text.
WJEC GCSE Computer Science
C Programming Language
ASCII LP1.
Chapter 3 - Binary Numbering System
ASCII and Unicode.
Section 6 Primitive Data Types
Presentation transcript:

Representing Characters 2.6 – Representing Data

Characters Alphanumeric characters are used to make words and strings. They include uppercase and lowercase letters, the digits 0-9, and symbols such as ? + and £. Computers are unable to process these characters directly as they only process binary code. So they need a way of converting these characters to binary code and vice versa. They can do this using character sets. Character sets are collections of characters that a computer recognises from their binary representation.

Key Definition to remember: Characters As well as the alphanumeric characters mentioned above, character sets also contain special characters which do certain commands (e.g. space, delete, enter). So when you press a button on your keyboard it sends a binary signal to the computer telling it which key you pressed. The computer then uses the character set to translate the binary code into a particular character. Key Definition to remember: What is a character set? A character set is a defined list of characters recognised by the computer hardware and software.

Character Sets ASCII is the most commonly-used character set in the English-speaking world. Each ASCII character is given a 7-bit binary code – this means that it can represent a total of 128 different characters, including all the letters in the English alphabet, numbers, symbols and commands. An extra bit (0) is added to the start of the binary code for each ASCII character. This means that each ASCII character fits nicely into 1 byte (8 bits). Extended ASCII is a character set which gives each character an 8-bit binary code, allowing for 256 characters to be represented. The first 128 characters are in exactly the same order as the ASCII characters. Extended ASCII is particularly useful for many European languages like French and German which include accents on some of the vowels, like á, Ô, and Ü. Unicode comes in several different forms and tries to cover every possible character that might be written. In its most common forms 16-bit and 32-bit binary codes. The best thing about Unicode is that it covers all major languages., even those that use a completely different alphabet like Greek, Russian and Chinese.

ASCII ASCII code represents alphanumeric data in most computers. Stands for: “American Standard Code for Information Interchange” It works like any other code. One thing represents another. In ASCII, binary is used to represent our numbers, letters and symbols. ASCII includes definitions for 128 characters: 33 are non-printing control characters (many now obsolete) that affect how text and space is processed and 95 printable characters, including space.

ASCII: Groupings The ASCII codes are grouped as follows: 0 - 32 Control codes (non-printing) 33 - 47 Printable symbols such as ! / \ & 48 - 57 The digits 0-9 58 - 64 Printable symbols such as < > = 65 - 90 Upper case characters A to Z 91 - 96 Printable characters including [ ] 97 - 122 Lower case characters a to z 123 - 127 Printable characters including { }

Non-printable control codes ASCII Non-printable control codes

Converting string characters to ASCII code To a computer, a character in a string is just a number; a number representing one of the characters in the ASCII code. An algorithm might need to find the ASCII code for a character. All programming languages have commands for this. Lets look an example using pseudocode…

Converting string characters to ASCII code CHR() to return a character from a number. ASC() to return a number from a character. Therefore: myString = CHR (67) Print (myString) Would return the letter upper case C as 67 is the ASCII code that letter. Entering: ASC (‘D’) Would return the number 68 as that is its number in the ASCII code.

Size of ASCII files Because on byte is used for each character, the size of a plain text file in bytes should be equal to the number of characters. Example: The file consist of 59 characters, including spaces, and so the size of the file should be 59 bytes.

Task 1: File Sizes Create an algorithm that will allow a user to enter a sentence of phrase and will then inform them of the size of the text file (in bytes) created. Remember: An algorithm could be written in pseudocode or drawn out as a flowchart. In an exam, you could use either method.

Task 2: ASCII Conversion Create an algorithm asking a user to input a sentence and then prints the codes (in denary) for each of the characters or symbols with each one printed on a new line. Remember: An algorithm could be written in pseudocode or drawn out as a flowchart. In an exam, you could use either method.