Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Math-Physics

Categories Conversion of Number Systems
Author: Mr.Ehab

 
Page 2
«prev 1 2 3 4 5 6 7 next»

EXPLANATION

Let me tell you what numbers these systems have and the procedure I followed to convert a certain number from one system to another.
a. The decimal system takes numbers between 0 and 9 only
b. The Binary system takes 0 and 1 only
c. The Octal system that takes numbers between 0 and 7 only
d. The Hexadecimal system takes numbers between 0 to 9 in addition to the string charaters (A(10), B(11), C(12), D(13), E(14), F(15))

The procedure for converting is approximately common for all systems. I'll explain the simplest conversion (decimal to binary). If the user types 82 as a decimal number, I try to find all the numbers that are less than to this number such that these numbers are powers of 2. That is:
1, 2, 4, 8, 16, 32, 64 (and not 128)

Then, I write them inversely: 64, 32, 16, 8, 4, 2, 1

I take 64 and divide it by 82. I notice that there is one 64 in 82. The result is 1 (first digit in the binary system). I also compute the remainder, which is 18. Then I take 32 and divide it by 18 and notice that there is no 32 in 18 and the division yields zero. So, the first two digits in the binary number are 1 and 0. I proceed in the same manner until I get the binary number: 1010010.

Note: To convert to binary, we take powers of 2 and apply the same method. To convert to octal, we take powers of 8 and apply the same method. To convert to hexadecimal, we take powers of 16 and apply the same method.

The FLA file is available for download. Well, all we need is a single layer made up of 5 keyframes in the main timeline. The first keyframe contains the definitions of all the functions used. I used 6 functions that do the following:
1) Function decimalToHexadecimal that converts from decimal system to Hexadecimal system
2) Function decimalToOctal that converts from decimal system to octal system
3) Function binaryToDecimal that converts from binary system to decimal system
4) Function decimalToBinary that converts from decimal system to binary system
5) Function octalToDecimal that converts from octal system to decimal system
6) Function hexadecimalToDecimal that converts from hexadecimal system to decimal system

We'll go over the scripts of all these functions line by line to understand how they execute.

I used 4 radiobuttons from Common Libraries/Smart Clips that let the user chooses among the four number systems. For instance, if he chooses Decimal number system, then the second keyframe will be executed. When the user then types in the decimal number and presses the convert button, the corresponding number is converted to binary, octal, and hexadecimal using 3 dynamic variables that exist through out the last 4 frames in the main timeline. The dynamic variables are (output1, output2, and output3).

«prev 1 2 3 4 5 6 7 next»

» Level Intermediate

Added: : 2002-03-04
Rating: 5.88 Votes: 42
Hits: 1098
» Author
Student studying Computer Engineering and Graphic Design.
» Download
Download the files used in this tutorial.
Download (34 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments