Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

ASSIGNMENT 2

MICRO-
PROCESSOR
BSCPE-3A

AERON L. ALMOSARA
WHAT ARE UNSIGNED
BINARY INTEGERS?

Unsigned binary integers are a way of


representing positive integers using only the digits
0 and 1 in binary form. In this system, the leftmost
bit (also known as the most significant bit)
represents a power of two, starting with 2^0. The
value of each subsequent bit doubles from the
previous one, so the second bit from the left
represents 2^1, the third bit from the left represents
2^2, and so on.
For example, the binary number 1101 represents the
decimal number:
1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0 = 13
Unsigned binary integers can represent positive
integers up to a certain maximum value,
depending on the number of bits used. For
example, a 4-bit unsigned binary integer can
represent values from 0 to 15, while an 8-bit
unsigned binary integer can represent values from
0 to 255.
WHAT ARE SIGNED
BINARY INTEGERS?

Signed binary integers are a way of representing


both positive and negative integers using binary
digits. In this system, the leftmost bit (most
significant bit) is used as the sign bit, with 0
indicating a positive number and 1 indicating a
negative number. The remaining bits represent the
magnitude of the number, using the same scheme
as unsigned binary integers.
For example, the 8-bit signed binary number
11011010 represents the decimal number:
-1 * 2^7 + 1 * 2^6 + 0 * 2^5 + 1 * 2^4 + 1 * 2^3 + 0 *
2^2 + 1 * 2^1 + 0 * 2^0 = -38
The first (leftmost) bit indicates that the number is
negative, and the remaining bits represent the
magnitude of the number (in this case, 11011010 is
the binary representation of the number 54).
WHAT ARE SIGNED
BINARY INTEGERS?

The most significant bit is also used to represent


the smallest value that can be represented with a
given number of bits. For example, with an 8-bit
signed binary integer, the most significant bit is
used to represent the value -128, while the
remaining bits represent values from -127 to +127.
Signed binary integers can be manipulated using
the same binary operations as unsigned binary
integers, but the sign bit must be treated
differently when performing arithmetic operations.
WHAT IS 1'S
COMPLEMENT NOTATION
AND 2'S COMPLEMENT
NOTATION?

1's complement notation and 2's complement


notation are two ways to represent signed binary
integers.
1's complement notation represents a negative
number by taking the 1's complement (flipping all
the bits) of the absolute value of the number and
then adding a negative sign bit. For example, the
8-bit 1's complement representation of the number
-38 would be:
1 0011010 (taking the 1's complement of 1101101)
2's complement notation represents a negative
number by taking the 2's complement (1's
complement plus 1) of the absolute value of the
number and then adding a negative sign bit. For
example, the 8-bit 2's complement representation
of the number -38 would be:
1 0011010 (taking the 2's complement of 1101101)
WHAT IS 1'S
COMPLEMENT NOTATION
AND 2'S COMPLEMENT
NOTATION?

Note that the most significant bit still represents the


sign of the number, with 0 indicating a positive
number and 1 indicating a negative number. In both
1's complement and 2's complement notation, the
range of representable values is from -(2^(n-1)-1) to
+(2^(n-1)-1), where n is the number of bits used.

2's complement notation is more commonly used


because it has several advantages over 1's
complement notation. First, there is only one
representation for zero, unlike in 1's complement
where both positive and negative zero can be
represented. Second, addition and subtraction of
signed numbers can be performed using the same
binary operations as for unsigned numbers,
simplifying hardware implementation. Finally, the
range of representable values is symmetric around
zero, which can simplify some arithmetic operations.
WHAT ARE THE BCD
CODE, EBCDIC CODE, &
ASCII CODE?
BCD code, EBCDIC code, and ASCII code are all
character encoding systems used to represent text
and symbols using binary digits.

BCD (Binary-Coded Decimal) code represents each


decimal digit using a 4-bit binary code, with each
digit represented by its corresponding binary value.
BCD code is often used in computing systems that
require accurate decimal arithmetic, such as financial
applications. For example, the BCD code for the
decimal number 789 would be 0111 1000 1001.

EBCDIC (Extended Binary Coded Decimal


Interchange Code) is a character encoding system
developed by IBM for use in mainframe computers. It
uses 8-bit codes to represent characters, with different
code values assigned to each character. EBCDIC
includes codes for characters not found in ASCII, such
as currency symbols and accented letters.
WHAT ARE THE BCD
CODE, EBCDIC CODE, &
ASCII CODE?

ASCII (American Standard Code for Information


Interchange) is a widely used character encoding
system that uses 7-bit codes to represent characters,
with 128 possible code values. ASCII includes codes
for the English alphabet (upper and lower case),
numerals, punctuation, and some control characters.
ASCII has been widely adopted as a standard
encoding system for text in computing systems and
is compatible with a wide range of devices and
operating systems.
WHAT ARE THE BCD
CODE, EBCDIC CODE, &
ASCII CODE?

Encoding System Description Example

Represents each The BCD code for


BCD (Binary-
decimal digit the decimal
Coded Decimal)
using a 4-bit number 789 would
Code
binary code. be 0111 1000 1001.

Developed by
IBM for use in
mainframe
EBCDIC
computers, uses 8- The EBCDIC code
(Extended Binary
bit codes to for the currency
Coded Decimal
represent symbol ¥ (yen) is
Interchange
characters and 0xF0.
Code)
includes codes for
characters not
found in ASCII.

Widely used
The ASCII code
ASCII (American character
for the letter A is
Standard Code encoding system
0x41
for Information that uses 7-bit
(hexadecimal) or
Interchange) codes to represent
65 (decimal).
characters.

You might also like