0% found this document useful (0 votes)
69 views

Binary and BCD Tutorial

This tutorial discusses binary and binary-coded decimal (BCD). It reviews the basics of binary numbers, including how they are written in base 2 using only 0s and 1s. It then explains how to convert between binary and decimal. The tutorial also covers adding binary numbers. Next, it defines BCD, showing how each decimal digit from 0-9 is represented by a 4-bit binary code. Students are instructed to practice converting decimal numbers to binary and BCD in their exercise books.

Uploaded by

Action
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Binary and BCD Tutorial

This tutorial discusses binary and binary-coded decimal (BCD). It reviews the basics of binary numbers, including how they are written in base 2 using only 0s and 1s. It then explains how to convert between binary and decimal. The tutorial also covers adding binary numbers. Next, it defines BCD, showing how each decimal digit from 0-9 is represented by a 4-bit binary code. Students are instructed to practice converting decimal numbers to binary and BCD in their exercise books.

Uploaded by

Action
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

BINARY AND BCD TUTORIAL

This tutorial should be used in conjunction with the Oxford book page 30 and the Skeete & Skeete page
33.

We have already been working with binary numbers.

What we already know:

 Binary takes the form of BASE 2


 The maximum digit which can be used in a base is one less than the base.
o `e.g. Base 10 uses numbers 0 – 9 and Base 8 uses number 0 – 7.
 Base 2 can only use 0 & 1, the only digits in the base.
 Reminder: in base 2, this number 10 cannot be called ten since ten is outside of the base. It is
called one naught ( some people prefer to say one zero).
 To convert from base 2 to base ten, we use the table:

64 32 16 8 4 2 1

The base 2 number is written under the headings, then the base 10 numbers under which a 1 fall are
added. `e.g. 110101 is calculated as 32+16+4+1 = 5310

 To convert from base 10 to base 2, the base 10 number is divided by 2 repeatedly until 0 R 1 is
reached. The remainders are then copies from bottom up and written Left to Right.

Adding in base 2
All additions surround the following basics: 0+0=0; 0+1=1; 1+1= 10; 1+1+1=11

Hence the example 1101011


+0111101
10101000

Hear is your practice exercises: Complete these in your exercise book.

Convert the following decimal numbers to binary:

(1) 48 (2) 85 (3) 121 (4) 96

Add the following binary numbers:

(1) 1100111 + 10010101 (2) 101001 + 011011 (3) 1111011 + 1100101

(4) 1010111 + 0111001

Now move on to BCD…….


Binary Coded Decimal – BCD
BCD must not be confused with regular binary numbers.
BCD uses the numbers 0 – 9 in four bit, base 2 numbers. Each digit in the base 10 number is represented
by its base 2 four bit code.
You already know them but here they are again:
0 = 0000 1 = 0001 2 = 0010 3 = 0011 4 = 0100 5 = 0101
6 = 0110 7 = 0111 8 = 1000 9 = 1001

With these numbers memorized, here is the BCD conversion of the number 635 without considering the
whether it is positive or negative.

6 = 0110 3 = 0011 5 = 0101 written together: 0110 0011 0101


The spaces between the numbers are only there to help you understand the structure of the number. Its
correct format is: 011000110101 (no spaces).

You must however note that the computer cannot assume anything. Therefore you must tell the
computer whether the number is positive or negative. To do this you must use a 4 bit code. There are
two formats which are accepted by CXC. Here there are:
For positive used either 1010 or 1110 For negative (minus) use either 1011 or 1111

So, to rewrite 635, which we assumed is a positive number, we must write either 1010 or 1110 to
represent the sign BEFORE writing the code for each digit.
Here it is: 1010 0110 0011 0101 correctly written: 1010011000110101
The alternative: 1110 0110 0011 0101 correctly written: 1110011000110101

If the number was -635 then the result would be 1011 0110 0011 0101 or 1111 0110 0011 0101

Key to remember: you MUST always write the sign bit First then the bits for each digit.

Here is you practice exercise:

Convert the following base 10 numbers to BCD:


(a) 492 (b) -170 (c) 994 (d) -283 (e) 405

You will be asked to present your books at the next class to show that you have completed the tutorial.

You might also like