Digital Logic · Unit 1 · 6 hrs
Binary Systems
Exam-focused notes for Binary Systems (Digital Logic, CSC116): what the TU syllabus asks and how it has actually been tested, with 7 solved past questions from this unit.
Binary Systems in short
This chapter introduces how a digital system represents and stores information: the binary number system and its conversions to and from octal and hexadecimal, the arithmetic techniques (complements and signed representation) that let a circuit subtract using only adders, the decimal and alphanumeric codes used to move data in and out of a machine, and the basic idea of a binary storage element.
What this unit covers
- Digital Systems
- Binary numbers
- Number base conversion
- Octal and hexadecimal numbers
- compliments
- Signed Binary numbers
- Decimal codes (BCD, 2 4 2 1,8 4 -2 -1,Excess 3, Gray Code)
- Binary Storage and Registers
- Binary logic
compliments
2081 · 5 marks
Given A=46 and B=35 represent them in binary and perform A-B using 1's complement method. [5]
Show solved answerHide answer
A − B Using 1's Complement Method
Given
- $A = 46$ (minuend)
- $B = 35$ (subtrahend)
- Operation: $A - B$ using 1's complement.
Solution
Convert to 8-bit binary
$46_{10}$: $32+8+4+2 = 46 \Rightarrow 0010,1110$
$35_{10}$: $32+2+1 = 35 \Rightarrow 0010,0011$
| Decimal | Binary (8-bit) |
|---|---|
| $A = 46$ | $0010,1110$ |
| $B = 35$ | $0010,0011$ |
1's complement of B (invert all bits)
$$B = 0010,0011 ;\Rightarrow; \overline{B} = 1101,1100$$
Add A and 1's complement of B
0010 1110 (A)
+ 1101 1100 (1's comp of B)
-----------
1 0000 1010
^
carry out = 1
End-around carry
A carry out of the MSB occurred, so add it back to the sum:
0000 1010
+ 1
-----------
0000 1011
Result
$$0000,1011_2 = 8 + 2 + 1 = 11_{10}$$
Since a carry-out (end-around carry) was produced, the result is positive.
Check: $46 - 35 = 11$ ✓
Summary
| Step | Value |
|---|---|
| $A$ | $0010,1110$ |
| $B$ | $0010,0011$ |
| $\overline{B}$ | $1101,1100$ |
| $A + \overline{B}$ | $1\ 0000,1010$ |
| After end-around carry | $0000,1011$ |
| Final Result | $0000,1011_2 = 11_{10}$ |
2080 · 5 marks
Question
Perform the following operations:
a. $(0111010)_2 - (110011)_2$ using 2's complement
b. $(89344){10} - (98654){10}$ using 9's complement
[2.5+2.5]
2079 · 5 marks
Carry out the following tasks:a. Perform 2's complement subtraction of 010110 - 100101b. Represent decimal number 10 in its BCD form [5]
2078 · 5 marks
Carry out the following tasks: a. Perform 1's complement subtraction of 10101-100101 b. Represent decimal number 0.125 into its binary form [2.5+2.5]
Binary logic
2078 · 5 marks
Write short notes on (Any Two): Negative Logic, CMOS, EBCDIC [5]
Show solved answerHide answer
Short Notes (Any Two): Negative Logic, CMOS, EBCDIC
1. Negative Logic
Definition: In digital systems, logic levels are represented by two voltage levels. The assignment of these voltage levels to logic 0 and logic 1 defines the logic convention used.
- In Positive Logic: The higher voltage level represents logic 1 and the lower voltage level represents logic 0.
- In Negative Logic: The lower voltage level represents logic 1 and the higher voltage level represents logic 0.
Key Points:
| Voltage Level | Positive Logic | Negative Logic |
|---|---|---|
| High (H) | 1 | 0 |
| Low (L) | 0 | 1 |
Effect on Gates:
- A gate that functions as an AND gate in positive logic behaves as an OR gate in negative logic, and vice versa.
- This is a direct consequence of De Morgan's theorem.
Example:
- A positive logic AND gate with inputs A, B and output F:
- F = A · B (positive logic)
- The same physical gate in negative logic performs: F = A + B (OR operation)
Significance:
- The choice of logic convention does not change the physical hardware; it only changes the interpretation of the signals.
- Negative logic is sometimes used to simplify circuit design or to match the active-low nature of certain hardware signals.
2. CMOS (Complementary Metal Oxide Semiconductor)
Definition: CMOS is a widely used technology for constructing integrated circuits. It uses a complementary pair of p-type (PMOS) and n-type (NMOS) Metal Oxide Semiconductor Field Effect Transistors (MOSFETs) to implement logic functions.
Basic Structure:
- Every CMOS gate consists of two networks:
- Pull-Up Network (PUN): Made of PMOS transistors, connects output to V_DD (logic 1) when active.
- Pull-Down Network (PDN): Made of NMOS transistors, connects output to GND (logic 0) when active.
- PUN and PDN are always complementary -- when one conducts, the other does not.
CMOS Inverter (NOT Gate):
VDD
|
[PMOS] <-- Gate Input A
|
+----> Output F = A'
|
[NMOS] <-- Gate Input A
|
GND
- When A = 1: NMOS ON, PMOS OFF → Output = 0
- When A = 0: NMOS OFF, PMOS ON → Output = 1
Characteristics of CMOS:
| Feature | Description |
|---|---|
| Power Consumption | Very low (static power near zero) |
| Noise Margin | High |
| Fan-out | High |
| Speed | Moderate to high |
| Integration | Very high density possible |
Advantages:
- Very low power dissipation -- power is consumed only during switching transitions.
- High noise immunity.
- Operates over a wide range of supply voltages (typically 3V to 15V).
- Suitable for VLSI design due to high packing density.
Applications:
- Microprocessors, memory chips (RAM, ROM), digital logic circuits, mobile devices.
3. EBCDIC (Extended Binary Coded Decimal Interchange Code)
Definition: EBCDIC is an 8-bit character encoding standard developed by IBM for use in its mainframe and midrange computer systems. The name stands for Extended Binary Coded Decimal Interchange Code.
Key Features:
| Feature | Detail |
|---|---|
| Bit Length | 8 bits per character |
| Total Characters | 2^8 = 256 possible characters |
| Developed by | IBM |
| Used in | IBM mainframes, AS/400 systems |
Structure:
- The 8 bits are divided into:
- 4 zone bits (higher order bits)
- 4 numeric bits (lower order bits)
- This is an extension of the older 6-bit BCD (Binary Coded Decimal) code.
Example of EBCDIC Codes:
| Character | EBCDIC Code (Hex) | EBCDIC Code (Binary) |
|---|---|---|
| A | C1 | 1100 0001 |
| B | C2 | 1100 0010 |
| 0 | F0 | 1111 0000 |
| 1 | F1 | 1111 0001 |
Comparison with ASCII:
| Feature | ASCII | EBCDIC |
|---|---|---|
| Bits | 7/8 bits | 8 bits |
| Developer | ANSI | IBM |
| Usage | Universal (PCs, Internet) | IBM mainframes |
| Characters | 128/256 | 256 |
Significance:
- EBCDIC was one of the earliest standardized character encoding systems.
- It is not compatible with ASCII, which often requires conversion when transferring data between IBM mainframes and other systems.
- Despite being largely replaced by ASCII and Unicode in modern systems, EBCDIC is still used in legacy IBM mainframe environments.
Note: Two of the above three topics are to be answered as per the question requirement (Any Two). All three are provided here for completeness.
Signed Binary numbers
2077 · 5 marks
List two major characteristics of digital computer. Represent -6 (negative six) using 8 bits in signed magnitude, signed-1's-complement and signed-2's-complement respectively. Represent decimal number 4673 in a) octal, and b) BCD. [5]
Number base conversion
2075 · 5 marks
Convert the following decimal numbers to the indicated bases. a) 7562.45 to octal b) 1938.257 to hexadecimal c) 175.175 to binary [2+1.5+1.5]
Make Unit 1 stick
Practice CSC116 with flashcards & quizzes