54 Threads found on edaboard.com: Hex To Bcd
Purpose: Convert a single byte into two bcd digits
Input: A = Byte to convert (0x00-0xFF)
Output: A = High nibble (ASCII 0x30-0x39,0x41-0x46)
R0 = Low nibble (ASCII 0x30-0x39, Value In Acc From hex To bcd.
Entry Requirements: Acc Has V
Microcontrollers :: 05.07.2004 01:33 :: silvio :: Replies: 4 :: Views: 2250
hex2bcd Converter using 8051
; Convert Value In Acc From hex To bcd.
; Entry Requirements:
; Acc Has Value In Binary To Convert To bcd
; On Exit:
; Acc Has Entry Value Converted (...)
Microcontrollers :: 05.02.2005 06:12 :: SphinX :: Replies: 9 :: Views: 63411
The secret to searching the net is using a couple of words and trying to think
of unique ones. E.g. in this case - hex bcd keypad. Note that "keypad" is a better
word than "keyboard" in this case. Also try to exclude words that you know will
trigger false hits.
I use to search and it performs well for me. It's a Swedish si
Hobby Circuits and Small Projects Problems :: 14.01.2005 08:19 :: XNOX_Rambo :: Replies: 8 :: Views: 1919
You didn't mention what is the length of the hex 8 bit, 16 bits ...etc
Ok here is a simple method to convert hex (8bit) to bcd
One restriction that method is vaild fot numbers 0 - 99 only.
for example if you want to convert 99 to bcd
1- divide 99 by 10
2- put the result in the high nibble of the (...)
Microcontrollers :: 12.03.2006 01:52 :: SphinX :: Replies: 5 :: Views: 26217
can any one suggest how to write an assembly language program for 8051 to convert hex to decimal ?
8-bit hex to bcd convertor
Handling of hexadecimal numbers for 8051 Assembly
Microcontrollers :: 28.06.2013 03:52 :: tpetar :: Replies: 1 :: Views: 460
anyone got a quick routine to converte hex to decimal (8 bits only) for 8051?
Microcontrollers :: 19.10.2003 17:29 :: Rafael :: Replies: 7 :: Views: 11156
What do you mean by "decimal number"? Is this bcd number?
In example, if you have 0x12 hexadecimally you want to change it to
bcd number: 0x18?
0x18 is decimal representation of 0x12 hexadecimal number.
C routine for that conversion (hexadecimal must be less than 0x64):
unsigned char (...)
Microcontrollers :: 27.11.2003 06:38 :: arturt134 :: Replies: 7 :: Views: 7107
I have problem in converting 26 bit binary to bcd using PIC 16F782 using assembly language.
I need to convert eg 2FAF080 hex to 50 000 000 dec using 4 registers casade together..
which mean 4 bytes. actually my application is to make use of timer0 as a counter to count the input freqency and store them in a 4 byte register.. then conv
Microcontrollers :: 01.06.2005 22:07 :: scdoro :: Replies: 1 :: Views: 1730
in my project i require bcd at port 0 and 3 of microcontroller 89s52 since there are three 7447 connected
(i.e p0.0-p0.3 to 7447(1) lsb,
which drive three 7 segment displays
now suppose i want to display (240)d then in the accumulator there is its hex equivalent i.e (F0)h which is proper but now w
Software Problems, Hints and Reviews :: 02.11.2008 08:56 :: pranitamm :: Replies: 1 :: Views: 1146
Hi there. I haven't the foggiest on the best way to do this in ASM. What I need is to convert a hex number to the hex representation of the decimal number. For example:
2Eh (It iss equal to 46d)
I need to end up with the byte in hex because of how I send the byte to the screen by converting each nibble (...)
Microcontrollers :: 04.05.2009 20:55 :: SavEagle :: Replies: 5 :: Views: 2086
See EDN Oct 7 2010 issue
Perform hexadecimal-to-bcdconversion in firmware - 2010-10-07 10:00:00 | EDN
Microcontrollers :: 22.10.2010 08:44 :: antedeluvian :: Replies: 18 :: Views: 5976
please can anyone send me 8051 asm code for hex-bcd
Microcontrollers :: 25.02.2011 23:08 :: subish_1087 :: Replies: 2 :: Views: 1242
the +-48 trick is used with numbers because it can convert a value 0-9 to a char representation 0-9 and vice versa,
you are obviously trying to convert a hex value of 0-15 (0-f) to the char 0-9 and a-f and vice versa.
You can use a condition that checks if the number is <=57 (which is char 9) and if true subtract the value 48 ,
if false then you
Microcontrollers :: 19.04.2011 14:28 :: alexan_e :: Replies: 2 :: Views: 1631
uint16 a1 = 0x1234; // a1 is an unsigned int value, not hexa
uint16 a2 = 4660; // a2 is an unsigned int value, not decimal either. And a1 = a2
uint16 a3 = 0x4660; // a3 is the bcd (binary coded decimal) value of a1 or a2
char * str1 = "0x1234"; // str1 is a string, that can represent a1 or a2 in hexadecimal (...)
Microcontrollers :: 28.03.2013 01:18 :: doraemon :: Replies: 1 :: Views: 763
the best solution for this kind of task is 4543 from cmos line up if you give me one day and aslo be more specific what you need is just want to interface thumb wheel switch,or you have some other task as well, which kind of thumb wheel you going to use hex or bcd
Hobby Circuits and Small Projects Problems :: 27.06.2004 10:01 :: Fragrance :: Replies: 3 :: Views: 1982
longValue: blk 4
mov X, 3
asr A (...)
Microcontrollers :: 19.10.2005 17:39 :: Gomez :: Replies: 13 :: Views: 13005
I need help with this module . It's to convert a binary value to its bcd equivalent assigning each digit to an element of an array. For example the binary value (11111111=ff hex) is equivalent to( 255 ) decimal so the 5 digit is assigned to the first element of the array......second 5 is assigned to the next element and 2 is assigned to the th
Microcontrollers :: 06.01.2006 12:53 :: Tulipmania :: Replies: 1 :: Views: 1674
and find hex/Dec Converter /LCD .. by Jacek Bogusz ..
24-bit binary to decimal(bcd) .. by Manoj R. Thakur ..
Microcontrollers :: 05.09.2006 21:02 :: IanP :: Replies: 3 :: Views: 1840
Please explain more clearly what you mean by "hex" and "decimal". Do you want to convert an ASCII string such as "12FC3B" into another ASCII string "1244219"? Or something else?
Microcontrollers :: 19.09.2006 07:38 :: echo47 :: Replies: 4 :: Views: 1788
I want to make an RPM meter in assambly lang. i did it as follows
1: i made 1 sec timer with T1 which does "2" step after every second. And i used T2 as event counter which is the input (P3.4) of the meter. it counts the pulses from sensor.
2:this routine saves the value of TL0 in ram then mulitplies it with 60 (3CH)to make it RPMs from RPS which
Microcontrollers :: 03.11.2006 09:18 :: Noman Yousaf :: Replies: 3 :: Views: 1742
Think this site will help you do your conversions -
Not sure what you are actually converting from / to - but generally it is binary / hex to a lcd decimal display - so the Ascii converters are the ones to use.
Microcontrollers :: 11.11.2009 17:49 :: wp100 :: Replies: 2 :: Views: 933
I wanted to use a 27c256 EPROM as a binary to bcd converter. Basically the 16 bit binar number is the address while a 8 bit bcd in the output. Simple enough. But I don't know how to produce a bin or hex file which would load the wanted data in the EPROM.
Please note that this is a part of a designing project and we are (...)
Hobby Circuits and Small Projects Problems :: 12.01.2010 14:36 :: blitzkreig :: Replies: 1 :: Views: 2516
16 bit hex to bcd @
Many codes available @
Microcontrollers :: 17.02.2010 12:20 :: amraldo :: Replies: 6 :: Views: 2845
my work is to read data from temperature sensor which is interfaced to 8051, i can read it but to display it , i need to convert hexadecimal to decimal, plz any one give some info how i can convert it and display it.
Microcontrollers :: 01.11.2010 02:12 :: vattipalli :: Replies: 7 :: Views: 6904
plz help me urgent
how to convert decimal value to hex value in 8051
plz send me the assembly code
Microcontrollers :: 30.06.2011 08:07 :: yashwanth450 :: Replies: 3 :: Views: 859
in 8051 series there is very easy to add 2 digits in bcd. "DA" instruction is used for this. now in AVR i want to add 10 digits with 5 digits. how that is possible in very low time, just like using DA in 8051. but unluckily there is not any instruction in AVR instruction set. please help me.
i know 1 method.
by using "ADC", do all in "hex" then
Microcontrollers :: 15.07.2012 14:22 :: Noman Yousaf :: Replies: 4 :: Views: 696
I need to convert decimal values 0 to 255 to hex. Can somebody please give me the c code for decimal to hex conversion?
Microcontrollers :: 26.11.2012 14:09 :: internetuser2k12 :: Replies: 46 :: Views: 1840
i need following topics for PIC16 in assembly language.
1. 16 bit (2 bytes) Addition, Subtraction, multiplication, division
2. conversion of numbers from hex to bcd.
3. equivalent function of DAW (in pic 18)
thanks in advance
Microcontrollers :: 20.07.2013 08:17 :: Noman Yousaf :: Replies: 2 :: Views: 205
Q1)which IC can be used as a bcd to hex converter?
Q2)circuit diagram or methodology for interfacing 4 thumwheel switches &
4 digit 7 segment display?
Electronic Elementary Questions :: 08.06.2004 13:08 :: Bhavik Shah :: Replies: 1 :: Views: 4661
2 ways to do this imo. Use common anode like sugested or use a bcd 7 segment display. The bcd saves portpins and gives you the A-F hex codes for free :-). If you have enough ports you can connect the displays to separate ports.
Microcontrollers :: 12.05.2005 10:01 :: Srammie :: Replies: 4 :: Views: 3017
you dont need floating point!
you just need fixed point.
it is easy, convert hex value to bcd and according you circuit specification assume one or 2 digit decimal point.
for example: reading 212 but print 2.12 Volt
Microcontrollers :: 27.11.2005 07:46 :: Davood Amerion :: Replies: 2 :: Views: 1852
Proff gave us the code and we need to modify it ... but we never learnt asembly so I don't understand the code in each step AT ALL..we have only 1 week..anyone has any idea? here is the codes
; period.asm: measures the period at pin p2.0
; by Jesus Calvino-Fraga, 2007
; Uses the serial port of the microcontroller to display the
; measured pe
Microcontrollers :: 07.02.2007 21:48 :: yasm81 :: Replies: 1 :: Views: 1175
can someone please help me out in designing a small function in c programming to accept decimal value as hex value, i mean lets say if user inputs a decimal value say 49, the processor should read(and futher processes) it as 0x49(hex value).
Microcontrollers :: 24.04.2007 04:20 :: lats :: Replies: 17 :: Views: 1934
I would like to convert the 16 bit hex value into 16 bit decimal value , can anyone tell me how i can do it in the C coding(keil). reply please...
Microcontrollers :: 12.02.2008 05:20 :: dayal :: Replies: 3 :: Views: 1393
I think you mean a bcd-to-7-segment decoder.
Here is the 'case' statement from a digital clock project that I wrote some time ago. Maybe it will help you.
'nibble' is the 4-bit input code (similar to your bcd value), and 'segment' is an 8-bit register connected to the 7-segment display (and its unused decimal point). It displays hex (...)
PLD, SPLD, GAL, CPLD, FPGA Design :: 26.05.2008 11:00 :: echo47 :: Replies: 1 :: Views: 6582
i need your help,how do i convert a hex to decimal using MPLAB assembly language?
Added after 2 minutes:
oh,forgot to mention. How do you convert FE to 254 with each digit in a different register?because i want to display it LCD
Microcontrollers :: 14.06.2008 02:33 :: mz_fadhli :: Replies: 6 :: Views: 3428
I want to convert a 6 digit decimal no into binary or hex format in assembly language. Please tell me how it could be done
I did for 5 digit conversion now i want for 6digit pl help me
Microcontrollers :: 10.06.2011 01:55 :: Sharath411 :: Replies: 3 :: Views: 1872
Programming a PIC microcontroller is very new thing to me but stilll i made a sincere effort of coding...
I would really appreciate if anybody could tell me whether my codes are rite or wrong...I am using 18f65j50 for remote monitoring and controlling of smps......Thnx in advance.. and one of doubts is how to convert hex into bcd...The codes
Microcontrollers :: 08.01.2012 13:24 :: sushma_odlc :: Replies: 0 :: Views: 413
Packed or Unpacked bcd?
The algorithm is fairly simple:
The hex equivalent of ASCII '0' is 30H, Therefore to convert a packed bcd to ASCII you must first unpack it and then add 30H to the unpacked bcd
Microcontrollers :: 15.06.2012 09:50 :: bigdogguru :: Replies: 9 :: Views: 3044
This is the opposite prob from what most folks want.
I need to convert a bcd number -- 6 digit -- into its binary/ hex equivalent. The bcd can be packed/ not packed. I prefer not-packed for now.
Can someone provide pointers to an 8-bit assembly implementation for an efficient algorithm ? Its for an AVR project, using Atmega48 as of now
Microcontrollers :: 08.02.2013 12:57 :: kripacharya :: Replies: 5 :: Views: 314
I am trying to set up a a 4-bit binary counter to rest at count ten.
Since I didn't have LS390' I had to create a condition rest clock made from an AND gate chip.
First I used one gate to get triggered when Qc and Qa where active. However when I do this it only
Analog IC Design and Layout :: 23.03.2013 20:19 :: Zanderist :: Replies: 2 :: Views: 263
Try DM9368 or SN7448 SN7449 !
DM9368 is bcd to hex display he is asking bcd to decimal, so best is CD4543
Microcontrollers :: 08.09.2004 09:27 :: Fragrance :: Replies: 3 :: Views: 1683
putchar is letting out a hex value of a said string or ascii.
If you want to print a number, you must use the printf command with the corresponding instructions.
Microcontrollers :: 13.02.2005 23:32 :: glenjoy :: Replies: 5 :: Views: 5654
1)For every key pressed once, do i have to store the decode logic in a register?like i mean if i wan't to get a numeric value "90" from the user, the two keys will be pressed once and each time i'll have to store them individually in a register. Then how do i go about decoding those two register values to get "90" as a number finally?
Microcontrollers :: 03.03.2005 22:10 :: IanP :: Replies: 2 :: Views: 2913
Jdhar is talking about HyperTerminal from Windows OS.
If you send from MCU to PC 00110000 and receive this bit stream in HyperTerminal you'll see on the screen 0 (as converted to ASCII).
But if you use a program made by you, can display as convenient (hex, bcd, binary, ASCII).
Microcontrollers :: 28.03.2005 13:31 :: silvio :: Replies: 10 :: Views: 946
I don't think it's possible to shift an integer number in this way.... should be in hex format... for example,,,
if you have this number 23 = 00010111 .... there is no way that you can shift this number to get just the 2, or 3 and leave the other. You should work in hex or any bit vector format, to see clearly which bits you want to shift.
PLD, SPLD, GAL, CPLD, FPGA Design :: 12.06.2005 14:27 :: jetset :: Replies: 7 :: Views: 1312
proteus lib ACTIVE/THUMB SWİTCH bcd
ACTIVE/THUMB SWİTCH hex
Microcontrollers :: 08.02.2006 01:45 :: necati :: Replies: 3 :: Views: 6094
How do you want to control this circuit? The above design uses 16 values (0-15) on 4 pins for frequency control. Basically, you could use 4 switches to get the 16 different values. That seems a bit clumsy to me, though.
There are bcd and hex rotary switches that encode on 4 output pins (+gnd) that would work. Pull the outputs high. H
Microcontrollers :: 27.02.2006 12:59 :: philba :: Replies: 2 :: Views: 768
I think that the best solution was given by another posts and is the multiplexing.
It turns the circuit more simplest and use less lines.
You can group the led and the activate by an transistor for example if the mux frequancy is high you will not notest the blink.
using the cpld to drive your led is an problem becouse with 5 led or 10 led is po
PLD, SPLD, GAL, CPLD, FPGA Design :: 05.08.2006 01:31 :: Ave_Rapina :: Replies: 6 :: Views: 2074
hi here is new models
3 digit cc and ca dispaly multiplexed
3 didgit voltmeter chip TC7107(ICL7107)
Thumb switch with commom pin bcd and hex
PCB Routing Schematic Layout software and Simulation :: 27.02.2007 01:05 :: Fragrance :: Replies: 12 :: Views: 15113