Docsity

Data Representation in Computer Science, Lecture notes of Computer science

Toggle sidebar
bg1
DATA REPRESENTATION
Computers can only process in binary, therefore each sample of data has a
corresponding binary code so the computer can understand it. Electronic transistors
turn on or off 1 or 0 to process this data. Processed using logic gates and stored. These
logic gates perform boolean functions on the binary input to process it and give a
binary output.
Denary โ†’ base 10
Binary โ†’ base 2
Hexadecimal โ†’ base 16
Why hex?
It is better to represent data in computer science using hexadecimal. It takes lesser
characters and can represent more binary digits. One hex digit can represent 4 bits.
- It is harder to read when there are too many binary values
- More the binary digits, the more prone it is to errors.
Basically
- Shorter to represent
- Errors can be observed better
- Large amounts of binary in better readable and manageable format
Memory addresses โ†’ location of a certain value in the RAM
Colour values โ†’ represents colour values in HTML (formating) /CSS (designing)
used for RGB
Error messages & debugging โ†’ shows where the error occurred and fixing it. (what
the error is about)
Memory dump โ†’ generated when an error is caused about all the details of what
occurred in the memory when the error has occurred. (eg: memory addresses etc) this
helps understand why the crash happened in the first place.
IP adresses โ†’ make it easier to understand when using it.
ASCII/Unicode โ†’ representation of a value using hex
Assembly language โ†’ low level language where the mnemonics are assigned to a hex
value which make the binary values more readable
URL โ†’ used for urls, eg: space is replaced with % and the value of space in ascii is
the denary value of 32, which in hex is 20. โ€˜%20โ€™
Overflow error -
When the result of a binary addition leads to the value exceeding the given register
and needs to accommodate more space.
pf3