Deprecated: Optional parameter $criteria declared before required parameter $revision_history is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.media.php on line 293

Deprecated: Optional parameter $post_url declared before required parameter $height is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/class.jetpack-post-images.php on line 781

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 2792

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 2810

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 2841

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 2866

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 2884

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 3026

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 3055

Deprecated: Optional parameter $value declared before required parameter $param is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php on line 3073

Deprecated: Optional parameter $slug declared before required parameter $attr is implicitly treated as a required parameter in /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/class.jetpack-gutenberg.php on line 844

Warning: Cannot modify header information - headers already sent by (output started at /home1/smartva9/public_html/smartvania/wp-content/plugins/jetpack/_inc/lib/class.media.php:293) in /home1/smartva9/public_html/smartvania/wp-includes/feed-rss2.php on line 8
SmartVania – SmartVania https://smartvania.com Village of wisdom Mon, 28 Dec 2020 04:41:58 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://smartvania.com/wp-content/uploads/2015/11/cropped-svicon1-32x32.png SmartVania – SmartVania https://smartvania.com 32 32 Live Python 3 Tutorial Series https://smartvania.com/live-python-3-tutorial-series/ Mon, 28 Aug 2017 19:23:12 +0000 http://smartvania.com/?p=1580

]]>
Temperature Conversion Formulas https://smartvania.com/temperature-conversion-formulas/ Mon, 28 Aug 2017 14:12:01 +0000 http://smartvania.com/?p=1560 Fahrenreit Celcius Kelvin Fahrenheit(F) F (F-32)*5/9 ((F-32)*5/9)+273.15 Celsius(C) (C*9/5) + 32 C C + 273.15 Kelvin(K) (K-273.15)*9/5 +32 K – 273.15 K Fahrenreit Celcius Kelvin ]]> Code Request https://smartvania.com/code-request-2/ Sun, 27 Aug 2017 04:04:45 +0000 http://smartvania.com/?p=1554

I was watching your videos on youtube about assembly, but I have many doubts… I have an exercise to do until next Sunday, and I don’t know how to do it!
The steps are:

A) Send the message: “Enter your registration number”;
B) Receive 9 numeric digits corresponding to a registration number;
C) If the registration is all zero, and the program (call the system with the exit operation)
D) Search in the registrations stored as constants in the program
D.1) If you find the registration, present the text:
“The registration number XXXXXXXXX corresponds to student YYYYYYYY.”
D.2) If you can not find the registration, please submit the text:
“Registration XXXXXXXXX was not found”
D.3) If the registration number corresponds to your registration number, present the text:
“It’s me! I’M YYYYY YYYYY YYYY and my register number is XXXXXXXXX ”
E) Go back to step “A”

The names must be stored using .asciiz and the registration numbers must be stored as a 32-bit integer, formatted as BCD, that is, every 4 bits, we have a decimal digit. The first number of the register number is always 1 and should not be stored. Registration example: 112345678 will be stored in hexadecimal as
12345678h (binary 0001_0010_0011_0100_0101_0110_0111_1000);

See below:

# Partially completed solution.
.data
message: .asciiz "Enter your registration number: "
found_message: .asciiz "The registration number XXXXXXXXX corresponds to student YYYYYYYY.\n"
not_found_message: .asciiz "Registration XXXXXXXXX was not found.\n"
my_number_found_message: .asciiz "It's me! I'M YYYYY YYYYY YYYY, and my register number is XXXXXXXXX.\n"
registration_names: .asciiz "XXXXXX", "YYYYYY"
registration_numbers: .word 0x0000000, 0x000000
my_number: .word 0x000000

.eqv ARRAY_SIZE 8 # 2 ints = 8 bytes
.text
main:
loop:
# Show prompt.
li $v0, 4
la $a0, message
syscall

# Get input.
li $v0, 5
syscall

# If all 0's, then end program.
move $a0, $v0
beqz $a0, main_exit

# Search (pass value to search in $a1).
move $a1, $a0
jal search_registration

b loop

main_exit:
li $v0, 10
syscall

# Expects user input in $a1.
search_registration:
# $t1 is loop index. $t2 is my number.
li $t1, 0
search_loop:
lw $a0, registration_numbers($t1)
beq, $a0, $a1, number_found
addi $t1, $t1, 4
beq $t1, ARRAY_SIZE, number_not_found
blt $t1, ARRAY_SIZE, search_loop

number_found:
lw $t2, my_number
beq $a0, $t2, my_number_found
li $v0, 4
la $a0, found_message
syscall

b search_registration_exit
my_number_found:
li $v0, 4
la $a0, my_number_found_message

syscall
b search_registration_exit
number_not_found:
li $v0, 4
la $a0, not_found_message
syscall
search_registration_exit:
jr $ra

]]>
MIPS Tutorial 38 – 2D Array Implementation https://smartvania.com/mips-tutorial-38-2d-array-implementation/ Fri, 18 Aug 2017 10:56:24 +0000 http://smartvania.com/?p=1551

]]>
2D Arrays (MIPS) a brief explanation https://smartvania.com/2d-arrays-mips-a-brief-explanation/ Fri, 18 Aug 2017 10:54:04 +0000 http://smartvania.com/?p=1549 ]]> Average Program (MIPS) https://smartvania.com/average-program-mips/ Fri, 18 Aug 2017 10:41:03 +0000 http://smartvania.com/?p=1546 ]]> Bit Manipulation (MIPS Tutorial) https://smartvania.com/bit-manipulation-mips-tutorial/ Fri, 18 Aug 2017 10:28:29 +0000 http://smartvania.com/?p=1543 ]]> MIPS questions https://smartvania.com/mips-questions/ Mon, 23 Jan 2017 04:04:01 +0000 http://smartvania.com/?p=1513

Hi Amell,

I just watched the entire series of MIPS tutorial that you have uploaded on your YT channel. First of all, thanks for that! It was awesome 🙂

Secondly, I have a few questions. As I am completely new to MIPS, I have received some tasks to do (from school) and do not know how they should be configured. Do you mind looking over them and give me some hints?

For analyze.asm:
Change the program so that only every third character is printed. The program must still stop after “Z”.

For hexmain.asm:
You will now write a small subroutine, that converts numbers in the range 0 through 15 into a printable ASCII-coded character: ‘0’ through ‘9’, or ‘A’ through ‘F’, depending on the number. For numbers not in the range 0 through 15, some bits will be ignored. In file hexmain.asm, add an assembly-language subroutine with the following specification. Name: The subroutine must be called hexasc. Parameter: One, in register $a0. The 4 least significant bits specify a number, from 0 through 15. All other bits in register $a0 can have any value and must be ignored. Return value: The 7 least significant bits in register $v0 must be an ASCII code as described below. All other bits must be zero when your function returns. Required action: The function must convert input values 0 through 9 into the ASCII codes for digits ‘0’ through ‘9’, respectively. Input values 10 through 15 must be converted to the ASCII codes for letters ‘A’ through ‘F’, respectively.

Thanks in advance!

Best regards,
A.
01/3/17

# hexmain.asm

# Written
2015-09-04
by F Lundevall

# Copyright abandonded
– this file is
in the public domain.

.text

main:

li
$a0,3
# change this to test different values

jal hexasc #
call hexasc

nop # delay
slot filler (just in case)

move
$a0,$v0
# copy return value to argument register

li
$v0,11
# syscall with v0 =
11 will print
out

syscall # one
byte from a0 to the Run I/O window

stop: j stop # stop after one run

nop # delay
slot filler (just in case)

# You can write your own code for hexasc here

#

hexasc:

andi
$a0,
$a0,
0xF # remove all bits except the
4 lsb.

addi
$v0,
$0,
0x30

addi
$t0,
$0,
0x9

ble
$a0,
$t0,
converter

nop

addi
$v0,
$v0,
0x7

converter:

add
$v0,
$a0,
$v0

jr
$ra

nop

-Amell

]]>
Trust in your intuitions https://smartvania.com/trust-your-intuition/ Sat, 07 Jan 2017 23:00:31 +0000 https://undsgn.com/uncode_new/?p=4231 [vc_row row_height_percent=”0″ override_padding=”yes” h_padding=”2″ top_padding=”3″ bottom_padding=”0″ overlay_alpha=”100″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column column_width_use_pixel=”yes” align_horizontal=”align_center” font_family=”font-134980″ overlay_alpha=”50″ gutter_size=”3″ medium_width=”0″ shift_x=”0″ shift_y=”0″ zoom_width=”0″ zoom_height=”0″ column_width_pixel=”800″][vc_column_text text_lead=”yes”]

Once I gave the headphones a thorough once-over exam, I tried them on. As I mentioned, they have a classic over-the-ear style and just looking at them, the padding on the ear pieces seem adequate and the peak of the headband seemed to be a bit lacking, but you don’t really know comfort unless you try on the product. So, I slipped the headphones on and found them to be exquisitely comfortable. Once I gave the headphones a thorough once-over exam, I tried them on. As I mentioned, they have a classic over-the-ear style and just looking at them, the padding on the ear pieces seem adequate and the peak of the headband seemed to be a bit lacking, but you don’t really know comfort unless you try on the product. So, I slipped the headphones on and found them to be exquisitely comfortable.

If no one hates you, no one is paying attention. If attention is what you want for vanity, confidence, or, hell — to make a decent living — then know that it’s not instantaneous. Every single person that you’re currently paying attention to, at some point in their lives, was in your exact position.

[/vc_column_text][/vc_column][/vc_row][vc_row row_height_percent=”0″ override_padding=”yes” h_padding=”2″ top_padding=”3″ bottom_padding=”3″ overlay_alpha=”100″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column column_width_use_pixel=”yes” align_horizontal=”align_center” font_family=”font-134980″ overlay_alpha=”50″ gutter_size=”3″ medium_width=”0″ shift_x=”0″ shift_y=”0″ zoom_width=”0″ zoom_height=”0″ column_width_pixel=”800″][vc_row_inner row_inner_height_percent=”0″ overlay_alpha=”50″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column_inner column_width_percent=”100″ position_horizontal=”left” align_horizontal=”align_center” gutter_size=”3″ overlay_alpha=”50″ medium_width=”0″ shift_x=”0″ shift_y=”0″ zoom_width=”0″ zoom_height=”0″ width=”1/1″][vc_custom_heading text_size=”bigtext” text_height=”fontheight-179065″ text_font=”font-850707″ text_transform=”uppercase” text_uppercase=””]You need to be
true to yourself[/vc_custom_heading][/vc_column_inner][/vc_row_inner][vc_column_text text_lead=”yes”]

Just like every other human on the planet, I have epically awesome days and days when life just turne against me. And while I can’t stand most self-help (see: tired quotes over stock photography on Instagram), sometimes I need a little pick-me-up. And most of the time, in order to get out of a slump (because my brain leans more into math/science than anything else), I need to drop a logic bomb on my ass.

Yes, this is a long article. But here’s the thing — if you’re reading this in your inbox and are already like, “fuck this!” delete it. No hard feelings. If you’re reading this in a browser on a website, and you see how tiny the scroll-bar is because of how far you still have to scroll to get to the bottom, close this tab and go back to 140-character tidbits of advice. Still with me? Phew. Just had to weed out all the folks from points: #1, #4 and #8. Welcome friends, onward we go.

[/vc_column_text][/vc_column][/vc_row][vc_row unlock_row=”” row_height_percent=”0″ override_padding=”yes” h_padding=”0″ top_padding=”0″ bottom_padding=”0″ overlay_alpha=”50″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column column_width_percent=”100″ overlay_alpha=”50″ gutter_size=”3″ medium_width=”0″ shift_x=”0″ shift_y=”0″ zoom_width=”0″ zoom_height=”0″][vc_single_image media=”11317″ media_width_percent=”100″ media_ratio=”sixteen-nine” media_title_uppercase=””][/vc_column][/vc_row][vc_row row_height_percent=”0″ override_padding=”yes” h_padding=”2″ top_padding=”3″ bottom_padding=”3″ overlay_alpha=”100″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column column_width_use_pixel=”yes” align_horizontal=”align_center” font_family=”font-134980″ overlay_alpha=”50″ gutter_size=”3″ medium_width=”0″ shift_x=”0″ shift_y=”0″ zoom_width=”0″ zoom_height=”0″ column_width_pixel=”800″][vc_row_inner row_inner_height_percent=”0″ overlay_alpha=”50″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column_inner column_width_percent=”100″ position_horizontal=”left” align_horizontal=”align_center” gutter_size=”3″ overlay_alpha=”50″ medium_width=”0″ shift_x=”0″ shift_y=”0″ zoom_width=”0″ zoom_height=”0″ width=”1/1″][vc_custom_heading text_size=”bigtext” text_height=”fontheight-179065″ text_font=”font-850707″ text_uppercase=””]Remember to
never give up[/vc_custom_heading][/vc_column_inner][/vc_row_inner][vc_column_text text_lead=”yes”]

If no one hates you, no one is paying attention. If attention is what you want for vanity, confidence, or, hell — to make a decent living — then know that it’s not instantaneous. Every single person that you’re currently paying attention to, at some point in their lives, was in your exact position. They kept at it and worked enough so that others started listening. Also know that if no one is watching, you can experience true freedom. Dance in your underwear. Write entirely for yourself. Like there’s a going-out-of-business sale. Find yourself — not in some coming-of-age hippie way involving pasta and ashrams— but in a way that helps you draw your own line in the sand for what matters and what doesn’t. Do what you want to do, just because you want to do that thing. This will build confidence that will come in handy later.

[/vc_column_text][/vc_column][/vc_row][vc_row unlock_row=”” row_height_percent=”0″ override_padding=”yes” h_padding=”0″ top_padding=”0″ bottom_padding=”0″ overlay_alpha=”50″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column][vc_gallery el_id=”gallery-17359″ medias=”11318,18258,11300,23505,11308,23505″ gutter_size=”2″ media_items=”media,icon” screen_lg=”600″ screen_md=”600″ screen_sm=”480″ images_size=”three-two” single_overlay_opacity=”50″ single_h_align=”center” single_padding=”2″ single_title_dimension=”h1″ single_icon=”fa fa-search3″ single_border=”yes” carousel_rtl=”” single_title_uppercase=””][/vc_column][/vc_row][vc_row row_height_percent=”0″ override_padding=”yes” h_padding=”2″ top_padding=”3″ bottom_padding=”3″ overlay_alpha=”100″ gutter_size=”3″ shift_y=”0″ row_height_use_pixel=””][vc_column column_width_use_pixel=”yes” align_horizontal=”align_center” font_family=”font-134980″ overlay_alpha=”50″ gutter_size=”3″ medium_width=”0″ shift_x=”0″ shift_y=”0″ zoom_width=”0″ zoom_height=”0″ column_width_pixel=”800″][vc_column_text text_lead=”yes”]

Once I gave the headphones a thorough once-over exam, I tried them on. As I mentioned, they have a classic over-the-ear style and just looking at them, the padding on the ear pieces seem adequate and the peak of the headband seemed to be a bit lacking, but you don’t really know comfort unless you try on the product. So, I slipped the headphones on and found them to be exquisitely comfortable. Once I gave the headphones a thorough once-over exam, I tried them on. As I mentioned, they have a classic over-the-ear style and just looking at them, the padding on the ear pieces seem adequate and the peak of the headband seemed to be a bit lacking, but you don’t really know comfort unless you try on the product. So, I slipped the headphones on and found them to be exquisitely comfortable.

If no one hates you, no one is paying attention. If attention is what you want for vanity, confidence, or, hell — to make a decent living — then know that it’s not instantaneous. Every single person that you’re currently paying attention to, at some point in their lives, was in your exact position. They kept at it and worked enough so that others started listening. Also know that if no one is watching, you can experience true freedom. Dance in your underwear. Write entirely for yourself. Like there’s a going-out-of-business sale. Find yourself — not in some coming-of-age hippie way involving pasta and ashrams— but in a way that helps you draw your own line in the sand for what matters and what doesn’t. Do what you want to do, just because you want to do that thing. This will build confidence that will come in handy later.

[/vc_column_text][/vc_column][/vc_row]

]]>
Code Request https://smartvania.com/code-request/ Sat, 02 Apr 2016 02:24:58 +0000 http://smartvania.com/?p=1184

Sir, can you please make quadratic equation solver in assembly or just
square root function I’m having a problem in square root part please
help?
Raj

2016-03-25 08:14

See below:
#——————————————————————————————
# Subroutine: sqrt
# Usage: v0 = sqrt(a0)
# Description:
# Takes a positive signed integer in $a0 and returns its integer square root
# (i.e., the floor of its real square root) in $v0.
# Arguments: $a0 – A positive signed integer to take the square root of.
# Result: $v0 – The floor of the square root of the argument, as an integer.
# Side effects: The previous contents of register $t0 are trashed.
# Local variables:
# $v0 – Number r currently being tested to see if it is the square root.
# $t0 – Square of r.
# Stack usage: none
#——————————————————————————————
sqrt: addi $v0, $zero, 0 # r := 0
loop: mul $t0, $v0, $v0 # t0 := r*r
bgt $t0, $a0, end # if (r*r > n) goto end
addi $v0, $v0, 1 # r := r + 1
j loop # goto loop
end: addi $v0, $v0, -1 # r := r – 1
jr $ra # return with r-1 in $v0

-Amell

]]>