Convert Two-Digit BCD to Binary in 8085

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

5K+ Views

In this program we will see how to convert BCD numbers to binary equivalent.Problem StatementA BCD number is stored at location 802BH. Convert the number into its binary equivalent andstore it to the memory location 802CH.DiscussionIn this problem we are taking a BCD number from the memory and converting it to its binaryequivalent. At first we are cutting each nibble of the input. So ifthe input is 52 (0101 0010) then we can simply cut it by masking the number by 0FH and F0H. When the Higher order nibble is cut, thenrotate it to the left four times to transfer ... Read More

Display Seconds with SimpleDateFormat in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

285 Views

To work with SimpleDateFormat class in Java, import the following package.import java.text.SimpleDateFormat;Now, set the format with SimpleDateFormat(“s”) to display seconds in one-digit.Format f = new SimpleDateFormat(”s”);Now, get the seconds in a string.String strSeconds = f.format(new Date());The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { // displaying current date and time Calendar cal = Calendar.getInstance(); SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MMMM/yyyy hh:mm:s"); ... Read More

Address Registers of 8257

Anvi Jain
Updated on 30-Jul-2019 22:30:24

636 Views

Every DMA channel consists an address register and a count register. These registers are 16-bits wide in length. In each 16 bits there are four ARs marked as AR3-0. Apart from four CRs there are control and status registers also. They are separate 8-bit registers, but have the same address. Here the processor can only write in the control register but we can read in the status register. Fig. Programmer's view at a glance of Intel 8257.We can select any one of the above registers by the address of the four pins marked as A3-0 of 8257. The processor used here writes to ... Read More

Convert 8-Bit Binary to BCD in 8085

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

12K+ Views

In this program we will see how to convert binary numbers to its BCD equivalent.Problem StatementA binary number is store dat location 800H. Convert the number into its BCD equivalent and store it to the memory location 8050H.DiscussionHere we are taking a number from the memory, and initializing it as a counter. Now in each step of this counter we are incrementing the number by 1, and adjust the decimal value. By this process we are finding the BCD value of binary number or hexadecimal number.We can use INR instruction to increment the counter in this case but this instruction ... Read More

Use ViewStub in Android

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

582 Views

Before getting into example, we should know what is view stub in android. It is a zero-sized lazy inflate view. it going to inflate at runtime. Using inflate() method, it going to inflate at runtime and append to window manager or view group. using setVisibility(int). we can show and hide view stub in android.This example demonstrates how to use view stub in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.       ... Read More

Show Slide Down to TextView in Android

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

547 Views

This example demonstrate about How to show Slide down to textview in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, text view is going to scroll down to particular position.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {     ... Read More

FTP Quit Function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

99 Views

The ftp_quit() function is an alias to ftp_close(). It closes an FTP connection.Syntaxftp_quit(con);Parameterscon − The connection to close.ReturnThe ftp_quit() function returns TRUE on success or FALSE on failureExampleThe following is an example that login to a connection works in it to change the directory and then the connection is closed −

Determine if File or Directory Exists in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

7K+ Views

The method java.io.File.exists() is used to check whether a file or a directory exists or not. This method returns true if the file or directory specified by the abstract path name exists and false if it does not exist.A program that demonstrates this is given as follows −Exampleimport java.io.File; public class Demo {    public static void main(String[] args) {       try {          File file = new File("c:/JavaProgram/demo1.txt");          file.createNewFile();          System.out.println(file.exists());       } catch(Exception e) {          e.printStackTrace();       } ... Read More

NavigableSet Class Lower Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

93 Views

The lower() method of NavigableSet returns the greatest element strictly less than the given element i.e. 35 here −lower(35);The following is an example to implement the lower() method in Java −Example Live Demoimport java.util.NavigableSet; import java.util.TreeSet; public class Demo { public static void main(String[] args) { NavigableSet set = new TreeSet(); set.add(10); set.add(25); set.add(40); set.add(55); set.add(70); set.add(85); set.add(100); System.out.println("Returned Value = " + set.lower(35)); } }OutputReturned Value = 25

Count Registers of 8257

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

648 Views

We have four Counters, ranging from CR3-0, which consists of 16 bits each. At the time when the CR becomes access to the processor which is 16-bits wide, the Least Significant and the Most Significant Byte of the register are accessed in an alternate manner, which starts with the Least Significant Byte. Also, the M/L* flip-flop helps here. The information about the number of bytes which are to be transferred using DMA are contained in the Counter Registers, which is decremented by 1 for every byte in the DMA data transfer. When the Counter Register becomes 0, the last DMA ... Read More

Advertisements