Sei sulla pagina 1di 3

Hex 2 Binary 2 Octal - C Tutorial General Method for Transforming Numbers - Number we want to transform uses base X: we would

like to transform this number into new one, that uses Y base. In this case we will use method of continuous dividing and multiplying (dividing numbers left of comma (,) with Y and multiplying numbers on the right side of comma, by Y - rational numbers). This method is best understood looking at these examples: Octal System: Base: 8 Digits: 0, 1, 2, 3, 4, 5, 6, 7 Example: 27 (decimal) = 33 8 (octal)

Hexadecimal (hex) System: Base: 16 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Example: 27 (decimal) = 1B 16 (hex)

Binary System: Base: 2 Digits: 0, 1 Example: 27 (decimal) = 11011 2 (binary)

Transforming Binary, Hex and Octal - Quickly Binary 2 3 4 40101 50110 60111 71000 A1011 D1110 5 6 7 81001 B1100 E1111 F Hex Binary 000 001 Octal0000 00001 10010 010 011 100 101 110 111 91010 C1101 20011 30100 0 1

Example Transform -6F,A 16 into binary number

-6F,A 16 = - 0110 1111 , 1010 2 = - 1101111 , 101 2

Example Transform 11,000011001 2 into hex number 11,000011001 2 = 000 1100 1000 2 = Example Transform 37,24 8 into binary number 37,24 8 = 011 111 , 010 100 2 = 11111 , 0101 2 11 , 0000 1100 1 2 = 3 , 3 , 0C8 16 = 0011 , 0 8 16

Example Transform 1111011,10011101 2 into octal number 1111011,10011101 2 = = 1 111 011 , 100 111 01 2 001 111 011 , 100 111 010 2 1 7 3 , 4 7 2 16 173 , 472 16 = =

Technorati Tags: Numeric, Numerical, Transform, Transformation, Binary, Decimal, Octal, Hexadecimal, Hex, Base, Complement, Method

6 Responses to Hex 2 Binary 2 Octal Randy of PUP on 11:30 AM Can you give me the exact conversion of binary to decimal, binary to octal, binary to hexadecimal in C Programming. Thanx. Hope to have it tomorrow. vurdlak on 4:09 PM You can find them in my sidebar (under "Learn Converting") If you use Internet Explorer, the sidebar could have escaped below this comment box ;( Mohan H N on 7:00 AM Dear Sir, I need subroutine module for Hex to decimal conversion for 8bit data, i need not to display the data i want to access the data. The input i will give from 8 bit reg and the converted data should be

input will be stored in 8bit reg ------ 0 to FF converted data stored in 2, 8bit reg - 0 to 255 hex final should be in another 2 8bit reg 0 to 100 decimal pls waiting for u r replay karthik balaguru on 4:13 AM Require some optimised 'Hexadecimal to binary' conversion C & C++ programs. Thx in advans, karthik balaguru julius ceasar beltran on 10:25 AM ei, i cant get what ur teaching is! please be more specific Milan Bhatt on 1:39 PM Can U give me a code for 1.Decimal to Binary, Hexa and Octal. 2.Binary to Hexa, Decimal and Octal 3.Octal to Bimary, Hexa and Binary 4.Hexa to Decimal, Octal and BinaryPosting your comment... Leave a Reply Name (required) Website Convert to boldConvert to italicConvert to link Remember me

This Website is optimized for Firefox. Users browsing with Internet Explorer may encounter problems while viewing pages.

Potrebbero piacerti anche