Docsity

Data Representation: Decimal to Binary, Octal, Hex, ASCII Codes and Conversion - Prof. Woo, Assignments of Computer Science

Toggle sidebar
bg1
Practice: Data representation
1. Convert the following decimal numbers to binary numbers
89 = 1011001
673 = 1010100001
1998 = 11111001110
2. Convert the following binary numbers to decimal
101110 = 46
1110101 = 117
110110100 = 436
3. Convert the following decimal numbers to the bases indicated
7562 to octal = 16612
1938 to hexadecimal = 792
4. Decode the following ASCII code:
1001010 1001111 1001000 1001110 01000000 1000100 1001111 1000101
74 79 72 78 64 68 79 69
J O H N @ D O E
5. Write your name in ASCII using an 8-bit code with the leftmost bit always 0. Include a
space between names and a period after a middle initial.
EX: KIM 75 73 77 (decimal)decimal)
1001011 1001001 1001101
pf3

Partial preview of the text

Download Data Representation: Decimal to Binary, Octal, Hex, ASCII Codes and Conversion - Prof. Woo and more Assignments Computer Science in PDF only on Docsity!

Practice: Data representation

1. Convert the following decimal numbers to binary numbers

2. Convert the following binary numbers to decimal

3. Convert the following decimal numbers to the bases indicated

7562 to octal = 16612

1938 to hexadecimal = 792

4. Decode the following ASCII code:

J O H N @ D O E

5. Write your name in ASCII using an 8-bit code with the leftmost bit always 0. Include a

space between names and a period after a middle initial.

EX: KIM 75 73 77 (decimal)decimal)

ASCII Hex Symbol 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0 1 2 3 4 5 6 7 8 9 A B C D E F

NUL

SOH

STX

ETX

EOT

ENQ

ACK

BEL

BS

TAB

LF

VT

FF

CR

SO

SI

ASCII Hex Symbol 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

1A

1B

1C

1D

1E

1F

DLE

DC

DC

DC

DC

NAK

SYN

ETB

CAN

EM

SUB

ESC

FS

GS

RS

US

ASCII Hex Symbol 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

2A

2B

2C

2D

2E

2F

(space) ! " # $ % & ' ( ) * + , -. / ASCII Hex Symbol 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

3A

3B

3C

3D

3E

3F

ASCII Hex Symbol 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

4A

4B

4C

4D

4E

4F

@ A B C D E F G H I J K L M N O

ASCII Hex Symbol 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

5A

5B

5C

5D

5E

5F

P Q R S T U V W X Y Z [ \ ] ^ _

ASCII Hex Symbol 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

6A

6B

6C

6D

6E

6F

` a b c d e f g h i j k l m n o ASCII Hex Symbol 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

7A

7B

7C

7D

7E

7F

p q r s t u v w x y z { | } ~