Friday, August 5, 2022

Assignment: 1A: 
Conversion of 
Decimal Number --> Binary, Octal and Hexadecimal
and 
Binary, Octal and Hexadecimal --> Decimal Number

12 comments:

  1. Base 10 (Decimal) — Represent any number using 10 digits [0–9] Base 2 (Binary) — Represent any number using 2 digits [0–1] Base 8 (Octal) — Represent any number using 8 digits [0–7] Base 16(Hexadecimal) — Represent any number using 10 digits and 6 characters [0–9, A, B, C, D, E, F]

    ReplyDelete
  2. In decimal to binary, we divide the number by 2, in decimal to hexadecimal we divide the number by 16. In case of decimal to octal, we divide the number by 8 and write the remainders in the reverse order to get the equivalent octal number. Decimal Number: All the numbers to the base ten are called decimal numbers.
    Binary to hexadecimal: Take groups of 4 bits, from right to left, and convert to hexadecimal digits directly. Octal to decimal: Take each digit from right to left, multiply it by the place value, and add to the running total. Octal to binary: Expand each octal digit into the 3 bits it represents (from left to right).

    ReplyDelete
  3. Decimal number:
    A number to the base ten is called decimal number and use the numbers from 0-9.
    Binary number:
    A number to the base 2 is called as binary number and it uses the numbers 0 and 1 only.
    Octal number:
    A number to the base 8 is called as octal number and it uses 0-7 numbers.
    Hexadecimal number:
    Hexadecimal is a numbering system with base 16. It can be used to represent large numbers with fewer digits. In this system there are 16 symbols or possible digit values from 0 to 9, followed by six alphabetic characters -- A, B, C, D, E and F.
    **In decimal to binary, we divide the number by 2.And write the remainders in reverse order.
    **In decimal to hexadecimal we divide the number by 16.
    **In case of decimal to octal, we divide the number by 8 and write the remainders in the reverse order to get the equivalent octal number.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Number to the base ten is called decimal number and use the numbers from 0-9.
    Binary number:
    A number to the base 2 is called as binary number and it uses the numbers 0 and 1 only.
    Octal number:
    A number to the base 8 is called as octal number and it uses 0-7 numbers.
    Hexadecimal number:
    Hexadecimal is a numbering system with base 16. It can be used to represent large numbers with fewer digits. In this system there are 16 symbols or possible digit values from 0 to 9, followed by six alphabetic characters -- A, B, C, D, E and F.
    **In decimal to binary, we divide the number by 2.And write the remainders in reverse order.
    **In decimal to hexadecimal we divide the number by 16.
    **In case of decimal to octal, we divide the number

    ReplyDelete
  6. ROLL NUMBER :- 21765A0327

    Decimal Number --> Binary, Octal and Hexadecimal

    Conversion of decimal fraction to binary fraction
    To convert a decimal fraction to its binary fraction, multiplication by 2 is carried out
    repetitively and the integer part of the result is saved and placed after the decimal point.
    The fractional part is taken and multiplied by 2. The process can be stopped any time
    after the desired accuracy has been achieved.
    Example: convert ( 0.68)10 to binary fraction.
    0.68 * 2 = 1.36 integer part is 1
    Take the fractional part and continue the process
    0.36 * 2 = 0.72 integer part is 0
    0.72 * 2 = 1.44 integer part is 1
    0.44 * 2 = 0.88 integer part is 0
    The digits are placed in the order in which they are generated, and not in the reverse
    order. Let us say we need the accuracy up to 4 decimal places. Here is the result.
    Answer = 0. 1 0 1 0…..

    Conversion of decimal to octal ( base 10 to base 8)
    Example: convert (177)10 to octal equivalent
    177 / 8 = 22 remainder is 1
    22 / 8 = 2 remainder is 6
    2 / 8 = 0 remainder is 2
    Answer = 2 6 1

    Conversion of decimal to Hexadecimal converter
    Divide the number by 16.
    Get the integer quotient for the next iteration.
    Get the remainder for the hex digit.
    Repeat the steps until the quotient is equal to 0.

    ReplyDelete
  7. The conversion of decimal numbers to
    ```````````````````````````````````````````````````````
    octal, hexadecimal
    ```````````````````````````
    <Computer can understand only binary language
    <If the number is likee (0.n) it show false statement and the computer automatically acess 0 to that number
    <If the number is likee (1.n) it show true statement and the computer automatically acess 1to that number
    Like decimal to binary fraction we had
    to multiply (*)the decimal number with respect to 2
    Example
    0.36 * 2 = 0.72 it display 0
    0.72 * 2 = 1.44 it display 1
    0.44 * 2 = 0.88 it display 0

    Like decimal to octal we had to divide (\)the decimal number with respect to 8.
    Example if a program is involved 177 / 8 = 22.5 remainder is 1
    22/ 8 = 2 remainder is 6
    2 / 8 = 0.25remainder is 2
    The final output is : 1,1,1
    Like decimal to hexadecimal we had to divide (\)the decimal number with respect to 16.
    Example if a program is involved
    1777/ 16 = 111.062 it display 1
    222/ 16 = 13.87it display 1
    285/ 16 = 17.43it display 1
    The final output is : 111

    ReplyDelete
  8. <Computer can understand only binary language
    <If the number is likee (0.n) it show false statement and the computer automatically acess 0 to that number
    <If the number is likee (1.n) it show true statement and the computer automatically acess 1to that number
    Like decimal to binary fraction we had
    to multiply (*)the decimal number with respect to 2
    Example
    0.36 * 2 = 0.72 it display 0
    0.72 * 2 = 1.44 it display 1
    0.44 * 2 = 0.88 it display 0

    Like decimal to octal we had to divide (\)the decimal number with respect to 8.
    Example if a program is involved 177 / 8 = 22.5 remainder is 1
    22/ 8 = 2 remainder is 6
    2 / 8 = 0.25remainder is 2
    The final output is : 1,1,1
    Like decimal to hexadecimal we had to divide (\)the decimal number with respect to 16.
    Example if a program is involved
    1777/ 16 = 111.062 it display 1
    222/ 16 = 13.87it display 1
    285/ 16 = 17.43it display 1
    The final output is : 111

    ReplyDelete
  9. *Convert (15)10 to binary
    Here base value = 2.

    2|15
    ----
    2|7 - 1
    ----
    2|3 - 1
    ----
    2|1 - 1

    (1111)2

    *Convert (34)10 to octal
    Here base value = 8.

    8|34
    ----
    8|4 - 2

    (42)8

    *Convert (255)10 to hexadecimal
    Here base value = 16.

    16|255
    ----
    16|15 - 15

    (15)(15)
    (ff)16

    *Convert (1001)2 to decimal
    = 1 x 2 3 + 0 x 2 2 + 0 x 2 1 + 1 x 2 0

    = 8 + 0 + 0 + 1

    = (9)10

    *(16)8 to decimal
    position = {1-1, 6-0}

    = 1 x 8 1 + 6 x 8 0

    = 8 + 6

    = (14)10

    *(16)16 to decimal
    position = {1-1, 6-0}

    = 1 x 16 1 + 6 x 16 0

    = 16 + 6

    = (22)10

    ReplyDelete
  10. Base ten is called decimal number and use the numbers from 0-9.
    Binary number:
    A number to the base 2 is called as binary number and it uses the numbers 0 and 1 only.
    Octal number:
    A number to the base 8 is called as octal number and it uses 0-7 numbers.
    Hexadecimal number:
    Hexadecimal is a numbering system with base 16. It can be used to represent large numbers with fewer digits. In this system there are 16 symbols or possible digit values from 0 to 9, followed by six alphabetic characters -- A, B, C, D, E and F.
    **In decimal to binary, we divide the number by 2.And write the remainders in reverse order.
    **In decimal to hexadecimal we divide the number by 16.
    **In case of decimal to octal, we divide the number

    ReplyDelete
  11. Base 10 (Decimal) — Represent any number using 10 digits [0–9] Base 2 (Binary) — Represent any number using 2 digits [0–1] Base 8 (Octal) — Represent any number using 8 digits [0–7] Base 16(Hexadecimal) — Represent any number using 10 digits and 6 characters [0–9, A, B, C, D, E, F]

    Reply

    ReplyDelete
  12. Decimal Number --> Binary, Octal and Hexadecimal

    Conversion of decimal fraction to binary fraction
    To convert a decimal fraction to its binary fraction, multiply the decimal fraction by 2 and the integer part of the answer is saved and noted after the decimal point.
    The fraction number is taken and multiplied by 2,continue this process till we get accurate value


    Conversion of decimal to Hexadecimal converter
    Divide the number by 16.
    Get the integer quotient for the next iteration.
    Get the remainder for the hex digit.
    Repeat the procedure until the quotient is equal to 0

    ReplyDelete

Program to read and display array elements

#include<stdio.h> void main() {     int a[50]; int n,i;     do     {         printf("\nEnter no. of elements in between 1 and 50:...