Tugas 3 [Dwi Nita Maulida] Sistem Bilangan"

SISTEM-SISTEM BILANGAN OPERASI DAN KODE

SISTEM BILANGAN
  •  Desimal 0-9
  • Biner 0-1
  • oktal 0-7
  • Hexadesimal 0-f
1. Bilangan Desimal
Dalam setiap bilangan desimal terdiri dari 10 digit, 0 sampai dengan 9
contoh : 
ungkapkan bilangan desimal 2745.214 sebagai penjumlahan nilai setiap digit 

2. Bilangan Biner 
  • Suatu Bilangan biner merupakan cara lain untuk melambangkan kuantitas, dimana 1 (high) dan 0 (low)
  • Sistem bilangan biner mempunyai nilai basis 2 dengan nilai setiap posisi dibagi dengan faktor 2
contoh : konversikan seluruh bilangan biner 1101101 ke desimal

Konversi Desimal Ke Biner
  • Metode Sum-Of-Weight
  • pengulangan pembagian dengan metode bilangan 2
  • konversi fraksi desimal ke biner
A. Metode Sum-Of-weight





Binary Arithmetic 
  • Binary arithmetic is essential in all digital computers and in many other types of digital systems
  • Addition, subtraction, multiplication, and division 
Binary Addition

Binary Subtraction


Binary Multiplication

Binary Division
Division in binary follows the same procedure as division in decimal
Example : 


1's and 2's complements of binary numbers
  • The 1's and 2's complements of binary numbers are very important because they permit the representation of negative numbers
  • The method of 2's compliment arithmetic is commonly used in computers to handle negative numbers
Finding the 1's Complement
The 1's complement of a binary number is found by changing all is to 0s and all 0s to 1s

Finding the 2's complement
The 2's complement of a binary number is found by adding 1 to the LSB of the 1's complement

Alternatife Method to find 2's complement
  • Start at the right with the LSB and write the bits as they are up and including the first 1
  • take the 1's complements of the remaining bits
Signed Numbers

Digital systems, such as the computer, must be able to handle both positive and negative numbers. A signed binary number consists of both sign and magnitude information. The sign indicates whether a number is positive or negative and the magnitude is the value of the number. There three forms in which signed integer (whole) numbers can be represented in binary:

Sign-Magnitude

1’s Complement

2’s Complement

The sign Bit

The left-most bit in a signed binary number is the which tells you whether the number is positive or negetive

0 = positive number and 1= negative number

sign- magnitude form

When a signed binary number is represented in sign-magnitude, the left-most bit is the sign bit and the remaining bits are the magnitude bits. The magnitude bits are in true (uncomplemented) binary for both positive and negative numbers.

Decimal number, +25 is expressed as an 8-bit signed binary number using sign-magnitude form as: 00011001

1's Complement form

Positive numbers in 1’s complement form are represented the same way as the positive sign-magnitude numbers. Negative numbers, however, are the 1’s complements of the corresponding positive numbers. Example: The decimal number -25 is expressed as the 1’s complement of +25 (00011001) as (11100110)

2's complement form

in the 2's complement form, a negative number is the 2's complement of the corresponding positive number

The Decimal value of signed numbers

sign magnitude : Decimal Value of positive and negative numbers in the sign-magnitude form are determined by summing the weights in all the magnitude bit positions where there are 1s and ignoring those positions where there are zeros.

1's complement : Decimal values of negative numbers are determined by assigning a negative value to the weight of the sign bit, summing all the weight where there are 1s and adding 1 to the result

2's complement: The weight of the sign bit in a negative number is given a negative value

Arithmetic Operation With Signed Number

In this section we will learn how signed numbers are added, subtracted, multiplied and divided. This section will cover only on the 2’s complement arithmetic, because, it widely used in computers and microprocessor-based system .

Addition 

both number positive  : the sum is positive and is therefore in true binary

positive number with magnitude larger than negative number: the final carry is discarderded. the sum is positive and is therefore in true binary

Negative Number with magnitude large than positive number : The sum is Negative and is Therefore in 2's complement form

both number negative : the final carry is discarded. the sum is negative and is therefore in 2's complement form 

Subtraction 

To subtract two signed  numbers, take the 2’s Complement of the subtrahend and ADD. Discard any final carry bit

Multiplication

The numbers in a multiplication are the multiplicand, the multiplier and the product.  Direct Addition and Partial Products are two basic methods for performing multiplication using addition.

Division 

The division operation in computers is accomplished using subtraction. Since subtraction is done with an adder, division can also be accomplished with an adder. The result of a division is called the quotient.

Hexadecimal Numbers

- Most digital systems deal with groups of bits in even powers of 2 such as 8, 16, 32, and 64 bits.

- Hexadecimal uses groups of 4 bits.

- Base 16

16 possible symbols

0-9 and A-F

- Allows for convenient handling of long binary strings.

- convert from hex to decimal by multipliying each hex digit by its positional weight.

- Convert from decimal to hex by using the repeated division method used for decimal to binary and decimal to octal conversion.

- Divide the decimal number by 16

- The first remainder is the LSB and the last is the MSB. 

Note, when done on a calculator a decimal remainder can be multiplied by 16 to get the result.  If the remainder is greater than 9, the letters A through F are used

- Hexadecimal is useful for representing long strings of bits.

- Understanding the conversion process and memorizing the 4 bit patterns for each hexadecimal digit will prove valuable later

BCD

- Binary Coded Decimal (BCD) is another way to present decimal numbers in binary form.

- BCD is widely used and combines features of both decimal and binary systems.

- Each digit is converted to a binary equivalent.

- To convert the number 87410 to BCD:

 

                             8            7            4

               1000   0111  0100   =  100001110100BCD

 

- Each decimal digit is represented using 4 bits.

- Each 4-bit group can never be greater than 9.

- Reverse the process to convert BCD to decimal

- BCD is not a number system.

- BCD is a decimal number with each digit encoded to its binary equivalent.

- A BCD number is not the same as a straight binary number.

- The primary advantage of BCD is the relative ease of converting to and from decimal.

Alphanumeric Codes
- Represents characters and functions found on a computer keyboard.

- ASCII – American Standard Code for Information Interchange.

a. Seven bit code: 27 = 128 possible code groups

b. Table 2-4 lists the standard ASCII codes

c. Examples of use are:  to transfer information between computers, between computers and printers, and for internal storage.

sumber : https://onlinelearning.uhamka.ac.id







Komentar

Postingan populer dari blog ini