Digital Representation
ASCII, which stands for American Standard Code for Information Interchange, is a 7-bit character code with values ranging from 0 to 127. It is a subset of the UTF-8 code and includes control characters and printable characters such as digits, uppercase letters, and lowercase letters. Unicode characters code is a superset of ASCII and contains values from 0 to 10FFFF16.
Representing Sound
In order for the computer to process sounds, they need to be converted to binary. Sound is captured by the microphone and then converted into a digital signal.
Representing Images
Images are broken up into individual pixels for digital representation.
Representing Numbers
Numbers in a computer system are represented by a string of bits called binary numbers. Computers use the binary base 2 number system. Binary digital components, known as transistors, operate in two states - on and off. Hexadecimal (base 16) and octal (base 8) are also used as compact forms for representing binary numbers.
Number System
The decimal (base 10) number system uses 10 symbols (0-9) called digits and utilizes positional notation. The binary (base 2) number system uses two symbols (0 and 1). A binary digit is called a bit, and eight bits make up a byte. The hexadecimal (base 16) number system uses symbols 0-9 and A-F. Hexadecimal numbers are denoted with a suffix "H".
Conversion
Binary to Decimal: Convert binary numbers to decimal using the weighted sum method.
Decimal to Binary: Divide the decimal number by 2 to find the binary number.
Binary to Hexadecimal: Divide the binary number into groups of 4 bits and convert each group to its hexadecimal equivalent.
Hexadecimal to Binary: Convert each hexadecimal digit to its binary equivalent.
Binary to Octal: Divide the binary number into groups of 3 bits and convert each group to its octal equivalent.
Octal to Binary: Convert each octal digit to its binary equivalent.
Number Representation - Signed
Positive numbers remain the same, while negative numbers are represented by complementing the number. There are three ways to represent signed integers: sign and magnitude, 1's complement, and 2's complement.
Addition and Subtraction
In addition, simply add the two numbers. For subtraction, convert the second value by adding 1 to it and then add the converted second value to the first value. Borrowing may be required for subtraction.
Overflow
Overflow occurs when the carried in and carried out bits are not equal. The range for overflow is between +7 and -8. Increasing the width of the range can help control overflow.
No comments:
Post a Comment