View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Decimal to Binary converter (Configurable)

5.0
5.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 16.8 KB File ID: #52006 Version: 1.0
image thumbnail

Decimal to Binary converter (Configurable)

by

James (view profile)

 

Convert Decimal to Binary number up to 4 bits

| Watch this File

File Information
Description

This Simulink model shows a simple code to convert decimal to binary numbers up to 8 bits (0 to 255 dec). It is easily configurable however, e.g if 9 bits is required, simply change 2 lines of the codes int he Matlab function block as shown below:
1)
a=zeros(1,8);
to
a=zeros(1,9);

2)
x=[a(8),a(7),a(6),a(5),a(4),a(3),a(2),a(1)];
to
x=[a(9),a(8),a(7),a(6),a(5),a(4),a(3),a(2),a(1)];

The code was modified to remove the bug during conversion at decimal 0.

Acknowledgements

Decimal To Binary In Simulink inspired this file.

This file inspired Binary Stopwatch With Arduino.

Required Products Simulink
MATLAB
MATLAB release MATLAB 8.5 (R2015a)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
24 Sep 2016 saqib

saqib (view profile)

Contact us