473,807 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Binary to Hexa Conversion

35 New Member
hello,
how to convert binary to hexa decimal.....


thanks & regards
lokiiiii
Jun 21 '07 #1
5 2367
miller
1,089 Recognized Expert Top Contributor
Start searching here:

perldoc search "hex"

And then simply follow the links to further documentation.

- Miller
Jun 21 '07 #2
lokeshrajoria
35 New Member
hello Miller,
that was not proper solution of my problem. my problem was convert a binary digit no to hexa decimal..
eg:
Binary= 1111
Hexa = 0xf

thanks and regards
Lokiiii
Jun 22 '07 #3
lokeshrajoria
35 New Member
i have this code but i want to write without using any function....
Expand|Select|Wrap|Line Numbers
  1. print "Gimme a number in binary: ";
  2. $num = <STDIN>;
  3. chomp $num;
  4. exit unless defined $num;
  5. $num = oct($num) if $num =~ /^0/; # does both oct, bin and hex
  6. printf "%d %x %o\n", $num, $num, $num;
  7.  
Jun 22 '07 #4
KevinADC
4,059 Recognized Expert Specialist
Why don't you want to use a function? Is this school work?
Jun 22 '07 #5
lokeshrajoria
35 New Member
Why don't you want to use a function? Is this school work?

hello kelvinADC,
i know this is school work but i want to know the internal work. how they function are work....so please help me....


Thank's and Regard's
Lokiiiiiiiii
Jul 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4572
by: Geoffrey | last post by:
I am working on a file conversion project that reads data from a one file format, reformats in and writes in out to another. The data is records of informations - names address, account number,statistics. The numeric values in the original file are stored in what appears to be a "packed" data format,using a structure that does not use any of the more standard "C" formats, so I can't use the "struct" module. As an example, the number...
4
5268
by: Dany | last post by:
Hi When I open an Hexa file I have some weird char like when I open it with Notepad. I want to open it in a readeable form (ex: "FF25AB") like with Ultra edit. Thanks regards, Dany
1
11743
by: Adam | last post by:
Hello, I'm trying to decifer the data in the table that stores the data in the binary format. All numbers are placed in varbinary fields. All I know is the MS SQL 2000 database useing collation SQL_Latin1_General_CP1_CI_AS (default). For example the content of the field is: (0xB4F5000000000000) in unicode and defined as varbinary(8).
3
1894
by: Poul Møller Hansen | last post by:
I'm struggling supporting national characters of different origin in a mixed environment using PHP, Perl and Java. I have a database created with character set UTF-8, but I'm in doubt when the data is stored as UTF-8 or latin1-9 then the clients are also doing some automatic character conversion. For this reason I need a way to see how the data are stored in the database
3
6897
by: Golan | last post by:
Hello, I have a hexa file which I need to convert to decimal. I use memcpy into variables (char for one octet, short for 2 octets and int for 4 octets) and then print the value into the file by using fprintf. The problem is that I don't know how to convert a field of 6 octets? Should I use a long variable? Thanks
5
6742
by: serrand | last post by:
Hello all, is there a way in order to write binary numbers as hexa or octal in c ? Xavier
7
19240
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006 00000000000000001111111111111111 11111111111111111111111111111111 00000000000000000000000000000000 11111111111111110000000000000000
1
2118
by: Chandra | last post by:
Hi, I have a problem related to File Reading. I have a file which contains data which is in Hexa format. I have to read that data and push it to a function which takes a parameter of type char. I am able to read the data from the file, which i am getting as characters. For example: Suppose the Hexa value from the File data is ABCDEFGH. In hexa form 0xAB is one byte. So, while reading this data A is taken as a byte which is not a...
2
5716
by: Sarath | last post by:
Is it possible to make lexical_cast function to support stirngs wtih '0x' format. e.g boost::lexical_cast<unsigned char>( "0x7E" ) This formatting throws bad_lexical_cast exception. Is there any way to do that?
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10112
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.