Marks Distribution and Importance
Chapter 2 is a high-weightage section, accounting for approximately 40 marks of the total
score. The marks are distributed as follows:
• Theory (18 Marks): Questions appearing in sections 1 through 4 of the theory paper.
• Programs (22 Marks): Question 5 is specifically dedicated to programs from this chapter.
• Strategic Value: Mastering this single chapter can significantly impact your result, potentially
helping you secure between 23 to 46 marks depending on the overall paper structure.
Fundamental Concepts: Number Systems
Understanding different number systems is essential for 8085 microprocessor programming.
• Decimal System (Base 10): Uses ten digits (0-9). Numbers are formed by combinations of these
digits.
• Binary System (Base 2): Uses only two digits, 0 and 1. The sources emphasize the importance of
memorizing binary conversions for numbers 0 to 15.
• Hexadecimal System (Base 16): This is the primary system used for 8085 microprocessor
programming.
o It uses digits 0–9 followed by letters A–F (where A=10, B=11, C=12, D=13, E=14, and
F=15).
o In the hexadecimal sequence, after 'F', the next number is '10' because the first set of
combinations is exhausted and a new set starting with '1' begins.
Conversions and Formatting
A key skill required for this chapter is converting between hexadecimal and binary.
• 4-Bit Uniform Format: For consistency in programming, hexadecimal digits should be
represented as 4-bit binary numbers. For example, even a small number like Hex '2' should be
written as binary '0010' instead of just '10'.
• Practical Examples:
o Hex 'A' converts to binary '1010'.
o Hex 'C' converts to binary '1100'.
Memory Structure and Allocation
The 8085 microprocessor supports up to 64K of memory, which translates to 65,536
individual memory locations.
• Memory Address: Each location is assigned a unique 16-bit address. In hexadecimal notation,
this is represented by 4 digits (e.g., 0000H to FFFFH).
• Memory Data: Each address location stores 8-bit data. This is represented by 2 hexadecimal
digits (e.g., 00H to FFH).
• Visual Representation: In memory diagrams, addresses are typically shown on the side (often in
red), while the data stored at those addresses is shown inside blocks (often in blue).
Data Units and Terminology
The sources define specific groupings of binary digits (bits) used in 8085 programming:
• Bit: A single binary digit, either 0 or 1.
• Nibble: A group of 4 bits, which corresponds to one hexadecimal digit.
• Byte: A group of 8 bits (or two nibbles), which corresponds to two hexadecimal digits. One byte
of data can represent 256 different values (0 to 255 in decimal).
,Hexadecimal to Binary Conversion
A critical skill for solving programs is converting hexadecimal addresses and data into
binary.
• The 4-Bit Rule: Each hexadecimal digit must be converted into a 4-bit binary sequence. For
example, the hex digit '0' must be written as '0000', not just '0'.
• Address Conversion: Since an address is 16-bit (4 hex digits), it converts into a 16-bit binary
number.
• Data Conversion: Since data is 8-bit (2 hex digits), it converts into an 8-bit binary number. For
instance, hex 'A' (1010) and hex '5' (0101) together as 'A5H' would be '10100101' in binary.
Programming Context
While 90% of your programming and calculations will involve 8-bit data, you must remain
aware that the microprocessor can also handle 16-bit data in certain conditions. However,
memory addresses are always 16-bit to ensure each of the 64,000+ locations can be uniquely
identified.
--------------------------------------------------------------------------------
Why Use Binary Addition?
The microprocessor does not perform hexadecimal addition directly because the rules are too
complex (there would be 256 different rule combinations for hex). Instead, it uses a simpler
system of binary addition where each hexadecimal digit is represented as a 4-bit binary
number.
The Rules of Binary Addition
To solve problems in Paper-II, you must master these five binary addition rules:
1. 0+0=0
2. 0+1=1
3. 1+0=1
4. 1+1=0 (with a Carry of 1 for the next position)
5. 1+1+1=1 (with a Carry of 1 for the next position)
Note: In binary, 1+1 equals '10', where '0' is the sum and '1' is the carry. Similarly, 1+1+1
equals '11', where '1' is the sum and '1' is the carry.
Step-by-Step Process for Hex Addition
When adding two hexadecimal numbers (e.g., 78H+38H):
• Step 1: Conversion. Convert each hex digit into its 4-bit binary equivalent using a standard
conversion chart (e.g., 7=0111, 8=1000).
• Step 2: Binary Addition. Perform the addition bit-by-bit from right to left, applying the rules
above and carrying over digits to the next column when necessary.
• Step 3: Back-Conversion. Group the resulting binary string into sets of 4 bits, starting from the
right side (LSB), and convert these groups back into hexadecimal digits to get your final answer.
Result Storage in 8085
• Accumulator: The final 8-bit result of the addition is stored in the Accumulator register.
• Carry Flag (CY): If the addition of two 8-bit numbers produces a 9th bit (a final carry), this
extra bit is stored in the Carry Flag, and the flag is said to be "set".
• 16-bit Addition: The 8085 can also perform 16-bit addition. The process is identical, but it
involves four hex digits (16 bits) instead of tw
, Advanced Hexadecimal Addition Insights
While you have learned the rules, the sources provide deeper context on why the 8085 uses
binary addition:
• Efficiency: Performing addition directly in hexadecimal would require the microprocessor to
follow 256 different rule combinations. Instead, it uses simple 4-bit binary conversion for each
hex digit.
• Handling Large Numbers: For 16-bit addition, the process remains the same (bit-by-bit
calculation), but the 8085 has specific arrangements to store these larger results as the instruction
set progresses.
• Result Storage: An 8-bit result is stored in the Accumulator, while any extra 9th bit (the final
carry) is stored in the Carry Flag.
Hexadecimal Subtraction
Subtraction in the 8085 is more complex than addition, especially when a smaller number is
subtracted from a larger one.
1. Direct Binary Subtraction: The microprocessor follows specific rules for bitwise
subtraction:
• 0−0=0.
• 1−1=0.
• 1−0=1.
• 0−1=1 (with a Borrow of 1 from the next position).
• When a borrow is taken, the 0 effectively becomes a 2 in decimal (or 10 in binary), making the
calculation 2−1=1.
2. 2's Complement Subtraction: Microprocessors often prefer the 2's complement method
because it allows them to use addition logic to perform subtraction and handle negative
results.
• Step 1: Find the 1's complement of the number to be subtracted by inverting all its bits (0
becomes 1, and 1 becomes 0).
• Step 2: Add 1 to the 1's complement to get the 2's complement.
• Step 3: Add this 2's complement to the first number.
• Interpreting the Result: If a carry is generated, the result is positive. If no carry is generated,
the result is negative and is stored in its 2's complement form.
Increment (INR) and Decrement (DCR)
These operations involve adding or subtracting exactly 1 from a hexadecimal number. To do
this quickly, you must be "familiar" with the hexadecimal sequence.
• Increment Examples:
o 09H+1=0AH (Note: It is not 10H because 'A' follows '9' in hex).
o 0FH+1=10H.
o 14FFH+1=1500H.
• Decrement Examples:
o 10H−1=0FH.
o 20H−1=1FH.
o 300H−1=2FFH.
The sources emphasize that without being comfortable with these hexadecimal sequences,
you will struggle to write and debug 8085 programs
Chapter 2 is a high-weightage section, accounting for approximately 40 marks of the total
score. The marks are distributed as follows:
• Theory (18 Marks): Questions appearing in sections 1 through 4 of the theory paper.
• Programs (22 Marks): Question 5 is specifically dedicated to programs from this chapter.
• Strategic Value: Mastering this single chapter can significantly impact your result, potentially
helping you secure between 23 to 46 marks depending on the overall paper structure.
Fundamental Concepts: Number Systems
Understanding different number systems is essential for 8085 microprocessor programming.
• Decimal System (Base 10): Uses ten digits (0-9). Numbers are formed by combinations of these
digits.
• Binary System (Base 2): Uses only two digits, 0 and 1. The sources emphasize the importance of
memorizing binary conversions for numbers 0 to 15.
• Hexadecimal System (Base 16): This is the primary system used for 8085 microprocessor
programming.
o It uses digits 0–9 followed by letters A–F (where A=10, B=11, C=12, D=13, E=14, and
F=15).
o In the hexadecimal sequence, after 'F', the next number is '10' because the first set of
combinations is exhausted and a new set starting with '1' begins.
Conversions and Formatting
A key skill required for this chapter is converting between hexadecimal and binary.
• 4-Bit Uniform Format: For consistency in programming, hexadecimal digits should be
represented as 4-bit binary numbers. For example, even a small number like Hex '2' should be
written as binary '0010' instead of just '10'.
• Practical Examples:
o Hex 'A' converts to binary '1010'.
o Hex 'C' converts to binary '1100'.
Memory Structure and Allocation
The 8085 microprocessor supports up to 64K of memory, which translates to 65,536
individual memory locations.
• Memory Address: Each location is assigned a unique 16-bit address. In hexadecimal notation,
this is represented by 4 digits (e.g., 0000H to FFFFH).
• Memory Data: Each address location stores 8-bit data. This is represented by 2 hexadecimal
digits (e.g., 00H to FFH).
• Visual Representation: In memory diagrams, addresses are typically shown on the side (often in
red), while the data stored at those addresses is shown inside blocks (often in blue).
Data Units and Terminology
The sources define specific groupings of binary digits (bits) used in 8085 programming:
• Bit: A single binary digit, either 0 or 1.
• Nibble: A group of 4 bits, which corresponds to one hexadecimal digit.
• Byte: A group of 8 bits (or two nibbles), which corresponds to two hexadecimal digits. One byte
of data can represent 256 different values (0 to 255 in decimal).
,Hexadecimal to Binary Conversion
A critical skill for solving programs is converting hexadecimal addresses and data into
binary.
• The 4-Bit Rule: Each hexadecimal digit must be converted into a 4-bit binary sequence. For
example, the hex digit '0' must be written as '0000', not just '0'.
• Address Conversion: Since an address is 16-bit (4 hex digits), it converts into a 16-bit binary
number.
• Data Conversion: Since data is 8-bit (2 hex digits), it converts into an 8-bit binary number. For
instance, hex 'A' (1010) and hex '5' (0101) together as 'A5H' would be '10100101' in binary.
Programming Context
While 90% of your programming and calculations will involve 8-bit data, you must remain
aware that the microprocessor can also handle 16-bit data in certain conditions. However,
memory addresses are always 16-bit to ensure each of the 64,000+ locations can be uniquely
identified.
--------------------------------------------------------------------------------
Why Use Binary Addition?
The microprocessor does not perform hexadecimal addition directly because the rules are too
complex (there would be 256 different rule combinations for hex). Instead, it uses a simpler
system of binary addition where each hexadecimal digit is represented as a 4-bit binary
number.
The Rules of Binary Addition
To solve problems in Paper-II, you must master these five binary addition rules:
1. 0+0=0
2. 0+1=1
3. 1+0=1
4. 1+1=0 (with a Carry of 1 for the next position)
5. 1+1+1=1 (with a Carry of 1 for the next position)
Note: In binary, 1+1 equals '10', where '0' is the sum and '1' is the carry. Similarly, 1+1+1
equals '11', where '1' is the sum and '1' is the carry.
Step-by-Step Process for Hex Addition
When adding two hexadecimal numbers (e.g., 78H+38H):
• Step 1: Conversion. Convert each hex digit into its 4-bit binary equivalent using a standard
conversion chart (e.g., 7=0111, 8=1000).
• Step 2: Binary Addition. Perform the addition bit-by-bit from right to left, applying the rules
above and carrying over digits to the next column when necessary.
• Step 3: Back-Conversion. Group the resulting binary string into sets of 4 bits, starting from the
right side (LSB), and convert these groups back into hexadecimal digits to get your final answer.
Result Storage in 8085
• Accumulator: The final 8-bit result of the addition is stored in the Accumulator register.
• Carry Flag (CY): If the addition of two 8-bit numbers produces a 9th bit (a final carry), this
extra bit is stored in the Carry Flag, and the flag is said to be "set".
• 16-bit Addition: The 8085 can also perform 16-bit addition. The process is identical, but it
involves four hex digits (16 bits) instead of tw
, Advanced Hexadecimal Addition Insights
While you have learned the rules, the sources provide deeper context on why the 8085 uses
binary addition:
• Efficiency: Performing addition directly in hexadecimal would require the microprocessor to
follow 256 different rule combinations. Instead, it uses simple 4-bit binary conversion for each
hex digit.
• Handling Large Numbers: For 16-bit addition, the process remains the same (bit-by-bit
calculation), but the 8085 has specific arrangements to store these larger results as the instruction
set progresses.
• Result Storage: An 8-bit result is stored in the Accumulator, while any extra 9th bit (the final
carry) is stored in the Carry Flag.
Hexadecimal Subtraction
Subtraction in the 8085 is more complex than addition, especially when a smaller number is
subtracted from a larger one.
1. Direct Binary Subtraction: The microprocessor follows specific rules for bitwise
subtraction:
• 0−0=0.
• 1−1=0.
• 1−0=1.
• 0−1=1 (with a Borrow of 1 from the next position).
• When a borrow is taken, the 0 effectively becomes a 2 in decimal (or 10 in binary), making the
calculation 2−1=1.
2. 2's Complement Subtraction: Microprocessors often prefer the 2's complement method
because it allows them to use addition logic to perform subtraction and handle negative
results.
• Step 1: Find the 1's complement of the number to be subtracted by inverting all its bits (0
becomes 1, and 1 becomes 0).
• Step 2: Add 1 to the 1's complement to get the 2's complement.
• Step 3: Add this 2's complement to the first number.
• Interpreting the Result: If a carry is generated, the result is positive. If no carry is generated,
the result is negative and is stored in its 2's complement form.
Increment (INR) and Decrement (DCR)
These operations involve adding or subtracting exactly 1 from a hexadecimal number. To do
this quickly, you must be "familiar" with the hexadecimal sequence.
• Increment Examples:
o 09H+1=0AH (Note: It is not 10H because 'A' follows '9' in hex).
o 0FH+1=10H.
o 14FFH+1=1500H.
• Decrement Examples:
o 10H−1=0FH.
o 20H−1=1FH.
o 300H−1=2FFH.
The sources emphasize that without being comfortable with these hexadecimal sequences,
you will struggle to write and debug 8085 programs