Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bits and Bytes in a computers memory Inside the computer are millions of electronic switches. These are grouped together in bundles of 8. A switch can.

Similar presentations


Presentation on theme: "Bits and Bytes in a computers memory Inside the computer are millions of electronic switches. These are grouped together in bundles of 8. A switch can."— Presentation transcript:

1 Bits and Bytes in a computers memory Inside the computer are millions of electronic switches. These are grouped together in bundles of 8. A switch can be either on or off. It can be seen then that a switch can stand for either a 1 when it is switched on or a 0 when it is switched off. The switches are gathered into bundles of eight, and by having them on and off different patterns can be made, e.g.: The system of numbers, which has only 0’s, and 1’s is called BINARY. Each 0 or 1 is a BInary digiT or BIT for short.

2 Basic Concepts A computer’s most basic element is a switch, either off or on. 10010000 00101110 01001101 10110100 11011010 00011101 11101000 10000101 10011010 01111011 00110110 11000010 RAM or ROM: switches Written in a book – machine code

3 Why 8 bits = 1 Byte? 8 different switches can have 256 different combinations. For exampleA given ASCII code 65 = 01000001 This is enough to cover:26 Upper case letters 26 lower case letters 10 different digits 0,1,2,…,9 All the punctuation marks on the keyboard e.g. !,”,£, |, *, #, etc. 4 or 6 bits would not be enough to cover all possibilities. There are still some code numbers left over using 8 bits; these are used in programming for special effects. They are called CONTROL CODES. We are all familiar with our characters in British English, but different countries use different character sets. Even America has slightly different characters. Think about Russian or Turkish!

4 8 bits=1 byte 1024 bytes =1 kilobyte ( 1 Kb) 1024Kb =1 megabytes ( 1 Mb) 1024 Mb =1 gigabyte( 1 Gb) 1024 Gb =1 terrabyte Someone has said that the storage of the human brain is just over 4 Terrabytes Storage Capacity This is how much data that RAM, ROM, disks etc. can hold

5 A disk is FORMATTED into tracks and sectors This allows the FILE MANAGEMENT system to find files on disk

6

7 Tape storage This uses SEQUENTIAL ACCESS i.e. the system has to read from beginning to end of the tape to find records or data. It is therefore slow. You would not want to use it at your home computer! Why use it? Robust High Capacity Cheap Easily stored Disk storage uses DIRECT ACCESS, because the disk read heads go directly to the start of the file to read the file. It is sometimes also called RANDOM ACCESS

8 How does information get stored on these lines of "magnetism"? Look at the diagram: All data is stored as binary numbers and the different polarities (i.e. north and south pole) lead to the binary digits being laid down on disk. As the read head passes over the microscopic magnets, a change in polarity is a ‘1’, and no change in polarity is a ‘0’. Disk READ HEAD Surface of the disk

9 Example. A book has 345 pages. Each page has an average of 82 lines, 9 words per line and 7 letters per word. How many bytes are required to store the book ? How many kilobytes is this? Solution:1 letters takes 1 byte; no. of letters= 345 X 82 X 9 X 7 =1782270 letters =1782270 bytes to store the book to change into kilobytes divide by 1024 = 1782270/1024 Kb = 1740.5 Kb

10 Data stored in a database Look at this record: Example. How much storage space would be required for 20,000 records like the one above? Solution.There are eight fields in each of the records. Field NameData TypeField Size Membership Number Alphanumeric8 SurnameText20 Middle Initials Text5 First NameText18 AgeNumber2 (numbers are always 2 in Access) Address 1Text25 Address 2Text25 Address 3Text25 The number of characters for each record is 8+20+18+5+2+25+25+25 = 128 Hence the total number of bytes required = 128x20000 bytes = 2560000 bytes = 2560000/1024 Kb = 2500 k

11 The PC computer (and MacIntosh) computers use directories to organise their filing system. The situation can be represented in this diagram: This is called a Hierarchical Filing system.

12 Interpreter Takes ONE line at a time Translates it Executes it Gets next line

13 ProCon InterpreterAs it executes lines of code after it translates, it finds errors quickly It does not produce object code As it re-translates each line of code inside a loop for example, it can be slow CompilerProduces fast object code Difficult to find errors

14 Assemblers. Assembly language is a LLL that can be used reasonably easily by scientists but is near to machine code (the actual language of the processor). ASSEMBLY: 1Used by experts to get memory efficient code 2Translates directly 3Gives fast machine code version 4 Similar to compiler These are location ADDRESSES in a number system called HEX These are codes for binary commands


Download ppt "Bits and Bytes in a computers memory Inside the computer are millions of electronic switches. These are grouped together in bundles of 8. A switch can."

Similar presentations


Ads by Google