Data representation: Difference between revisions
Mr. MacKenty (talk | contribs) No edit summary |
Mr. MacKenty (talk | contribs) |
||
(24 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[File:binary.png|frame|right|This is a basic concept in computer science]] | [[File:binary.png|frame|right|This is a basic concept in computer science]] | ||
Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit, is the smallest unit of data in computing. It is represented by a 0 or a 1. Binary numbers are made up of binary digits (bits), eg the binary number 1001. | Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit, is the smallest unit of data in computing. It is represented by a 0 or a 1. Binary numbers are made up of binary digits (bits), eg the binary number 1001. | ||
Line 8: | Line 9: | ||
To include strings, integers, characters and colours. This should include considering the space taken by data, for instance the relation between the hexadecimal representation of colours and the number of colours available. | To include strings, integers, characters and colours. This should include considering the space taken by data, for instance the relation between the hexadecimal representation of colours and the number of colours available. | ||
[https://www.youtube.com/watch?v=pmY7pOQCOr8 This video is superb place to understand this topic] | |||
== | == How a file is stored on a computer == | ||
<html> | <html> | ||
<iframe width="560" height="315" src="https://www.youtube.com/embed/ | <iframe width="560" height="315" src="https://www.youtube.com/embed/KN8YgJnShPM" frameborder="0" allowfullscreen></iframe> | ||
</html> | </html> | ||
== | == How an image is stored in a computer == | ||
<br /> | |||
An image is a matrix of pixel values. Essentially, every image can be represented as a matrix of pixel values<ref>https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/</ref> | |||
<br /> | |||
[[File:8-gif.gif]] | |||
<br /> | |||
== The way in which data is represented in the computer. == | |||
To include strings, integers, characters and colours. This should include considering the space taken by data, for instance the relation between the hexadecimal representation of colours and the number of colours available<ref>IBO Computer Science Guide, First exams 2014</ref>. | |||
'''Integer:''' | |||
Each integer is represented in binary. Where a single number will usually be represented in one byte. | |||
'''Characters:''' | |||
Each character is usually one byte, represented in binary. | |||
'''Unicode:''' | |||
[http://unicode-table.com/en/ Unicode] is a standardization of assigning values to a specific character, this is needed as there are hundreds of different characters in different languages and if done by each community there would likely be overlaps. | |||
'''Strings:''' | |||
A concatenation of characters. Will be represented in binary, as each 8 bit character following each other. Each word will be around 16-32 bits. | |||
'''Colors:''' | |||
Are represented in hexadecimal number system. Will be 6 hexadecimal values 2 for each prime colour, in the order of Red, Green, Blue (RGB.) For | |||
example the colour red will be FF 00 00. When viewed on a screen it will usually have a hash tag before the value, e.g. #FF 00 00. | |||
A maximum of around 16.8 million different colours may be input.(16 to the power of 6 or 2 to the power of 24.). Please see [https://en.wikipedia.org/wiki/Web_colors this EXCELLENT chart to better understand how hexidecimal is used to express colors] | |||
This helpful material is used with gratitude from a computer science wiki under a Creative Commons Attribution 3.0 License<ref>https://compsci2014.wikispaces.com/2.1.10+Outline+the+way+in+which+data+is+represented+in+the+computer</ref> | |||
== Sound == | |||
* [https://academo.org/demos/virtual-oscilloscope/ Let's look at an oscilloscope] | |||
* [https://www.bbc.co.uk/bitesize/guides/zpfdwmn/revision/3 The BBC has an excellent article on how computers represent sound] | |||
Line 30: | Line 59: | ||
* [[Binary]] | * [[Binary]] | ||
== Standards == | |||
* Outline the way in which data is represented in the computer. | |||
== References == | == References == |
Latest revision as of 08:10, 8 May 2023
Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit, is the smallest unit of data in computing. It is represented by a 0 or a 1. Binary numbers are made up of binary digits (bits), eg the binary number 1001.
The circuits in a computer's processor are made up of billions of transistors. A transistor is a tiny switch that is activated by the electronic signals it receives. The digits 1 and 0 used in binary reflect the on and off states of a transistor.
Computer programs are sets of instructions. Each instruction is translated into machine code - simple binary codes that activate the CPU. Programmers write computer code and this is converted by a translator into binary instructions that the processor can execute.
All software, music, documents, and any other information that is processed by a computer, is also stored using binary.[1]
To include strings, integers, characters and colours. This should include considering the space taken by data, for instance the relation between the hexadecimal representation of colours and the number of colours available.
This video is superb place to understand this topic
How a file is stored on a computer[edit]
How an image is stored in a computer[edit]
An image is a matrix of pixel values. Essentially, every image can be represented as a matrix of pixel values[2]
The way in which data is represented in the computer.[edit]
To include strings, integers, characters and colours. This should include considering the space taken by data, for instance the relation between the hexadecimal representation of colours and the number of colours available[3].
Integer: Each integer is represented in binary. Where a single number will usually be represented in one byte.
Characters: Each character is usually one byte, represented in binary.
Unicode: Unicode is a standardization of assigning values to a specific character, this is needed as there are hundreds of different characters in different languages and if done by each community there would likely be overlaps.
Strings: A concatenation of characters. Will be represented in binary, as each 8 bit character following each other. Each word will be around 16-32 bits.
Colors: Are represented in hexadecimal number system. Will be 6 hexadecimal values 2 for each prime colour, in the order of Red, Green, Blue (RGB.) For example the colour red will be FF 00 00. When viewed on a screen it will usually have a hash tag before the value, e.g. #FF 00 00. A maximum of around 16.8 million different colours may be input.(16 to the power of 6 or 2 to the power of 24.). Please see this EXCELLENT chart to better understand how hexidecimal is used to express colors
This helpful material is used with gratitude from a computer science wiki under a Creative Commons Attribution 3.0 License[4]
Sound[edit]
See Also[edit]
Standards[edit]
- Outline the way in which data is represented in the computer.