Computer Codes and Symbols

Bits, Bytes, ASCII

Digital computers use binary numbers to represent and store data. Why use binary numbers? For simplicity. While the decimal system (base 10) must use ten different digits (0-9) to represent numbers, the binary system (base 2) requires only two digits (0-1).

Since we only need two digits to represent any number, it becomes quite easy to use electrical circuits which act like switches to represent 0 as "off" and 1 as "on". (This is why in the digital age many manufacturers show off and on as 0|1 on their appliances). So, computer memory chips are simply many, many (electronic) switches, each with the ability to represent either 0 or 1.

The standard unit of measurement for storage capacity on a computer is the byte. One byte is used to represent and store one character, which can be a letter, number, or other symbol. (Or, in the case of graphics, one byte represents one pixel).

One byte is composed of 8 bits. What is a bit? A bit is one binary digit: either a 1 or a 0. Why eight bits in one byte? Well, if there were only two bits in a byte, then we could only represent four distinct characters, because there are only 22 possible combinations of two digits which can only be either 0 or 1. If there were a maximum of four bits in a byte then we could represent 24 or 16 different characters. When we count the number of different characters we need to represent (A-Z, a-z, and 0-9, plus an assortment of various other symbols such as punctuation marks, etc.) it is obvious that considerably more than 4 bits (binary digits) per byte will be required. So how many bits are actually necessary?

Microcomputer designers originally decided that the capacity to represent 128 different characters would suffice. Later, engineers decided that 256 characters would be better. So, it turns out that to represent 256 different characters we need a maximum of 8 bits (28 = 256 unique combinations).

If we use different combinations of 8 bits to represent all 256 characters in computer storage, the question arises, which binary number represents which character? We get our answer from something called the ASCII table. The American Standard Code for Information Interchange, ASCII (as-key), is the standard that decrees what character is represented by what number.

ASCII characters 32-126 represent upper and lower-case English alphabetic characters, the digits 0-9, and punctuation marks.

ASCII characters 128-255 represent diatonic characters (, , , etc.), box-drawing characters (, , , etc.), and mathematical symbols (, , , , etc.).

Those odd looking ASCII characters from 0-31 and 127 are called the control characters. They are used as signals to control printers and other hardware devices.

Wait, I hear you say, didn't I tell you that ASCII uses binary numbers to represent characters? It does, but although computers are whizzes with 8-digit binary numbers, people are not. Therefore, for our convenience, the ASCII table shows us humans the decimal equivalents for those binary numbers. For example, "B" is represented as 1000010 inside a computer, but the ASCII table shows 66, the decimal equivalent of 1000010.

Now that you understand ASCII, here's a little trick you can do. In an application program, hold down the Alt key while you key in the ASCII decimal number for a character using the numeric key-pad. When you have finished, release the Alt key and the character corresponding to the number will appear on the screen.

A final note: when computers sort things, they do so according to the ASCII value of characters. The reason why an item with a space in front of it will appear at the top of a list is that the space character is ASCII 32, while "A" is ASCII 65.




1 J

2 J

3

4

5

6

7

8 _

9 m

10 _

11 _

12 _

13 _

14 _

15 R

16

17

18

19 _

20

21

22 n

23

24

25

26

27

28 _

29

30

31

32

33 !

34 "

35 #

36 $

37 %

38 &

39 '

40 (

41 )

42 *

43 +

44 ,

45 -

46 .

47 /

48 0

49 1

50 2

51 3

52 4

53 5

54 6

55 7

56 8

57 9

58 :

59 ;

60 <

61 =

62 >

63 ?

64 @

65 A

66 B

67 C

68 D

69 E

70 F

71 G

72 H

73 I

74 J

75 K

76 L

77 M

78 N

79 O

80 P

81 Q

82 R

83 S

84 T

85 U

86 V

87 W

88 X

89 Y

90 Z

91 [

92 \

93 ]

94 ^

95 _

96 `

97 a

98 b

99 c

100 d

101 e

102 f

103 g

104 h

105 i

106 j

107 k

108 l

109 m

110 n

111 o

112 p

113 q

114 r

115 s

116 t

117 u

118 v

119 w

120 x

121 y

122 z

123 {

124 |

125 }

126 ~

127 _

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152 _

153

154

155

156

157

158 _

159

160

161

162

163

164

165

166

167

168

169 _

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224 a

225

226 G

227 p

228 S

229 s

230 m

231 t

232 F

233 Q

244 W

235 d

236

237 f

238 e

239

240

241

242

243

244

245

246

247

248

249

250

251

252 _

253

254 n