8-bit

Add two 32-bit numbers using 8-bit registers

匆匆过客 提交于 2021-02-10 14:39:48
问题 The goal here is two add two 32-bit numbers stored in little-endian notation. The numbers are stored in the following memory cells: first number: 0x3000-0x3003 seconds number: 0x4000-0x4003 the result should go into: 0x5000-0x5003 The following is my implementation, that is not very efficient in terms of DRY principle: ARG1 EQU 3000H ARG2 EQU 4000H RESULT EQU 5000H ORG 0000H MOV DPTR, #ARG1 + 0 MOV A, #12H MOVX @DPTR, A MOV DPTR, #ARG1 + 1 MOV A, #34H MOVX @DPTR, A MOV DPTR, #ARG1 + 2 MOV A,

Java for ImageJ. How to convert an image from RGB to 8 bit using code?

淺唱寂寞╮ 提交于 2021-02-08 04:07:39
问题 I am currently working on Connected Component Labelling. This is a process which takes an image and tells you how many separate objects are in the Image. My problem is that at the very start I need to be able to take any image (specifically RGB value) and convert it into 8-bit. EDIT: as in literally considered an 8bit, where the image is no longer recognised as RGB. Not an 8bit image that is recognised as an RGB. Is there a way using code to automatically do this without having to go into the

Replace colors in colormap (python 3.7)

假装没事ソ 提交于 2021-01-28 12:20:19
问题 I use a simple line to break an indexed image 256 color into palette using import numpy as np from PIL import Image im = Image.open('') palette = np.array(im.getpalette(),dtype=np.uint8).reshape((256,3)) ##################### Printed result [[ 1 3 0] [ 2 4 1] [ 28 0 4] [ 20 2 26] [ 24 5 18] [ 33 7 22] [ 36 7 12] [ 0 20 18] [ 42 15 16] [ 43 18 30] ... etc Printing 'palette' lists the colors as RGB values as listed from index 0 onward. Index 0 is often dark color or black. In some engines it is

Port MARS MIPS code to work on eight bit CPU simulator ( sms32v50 )

谁都会走 提交于 2020-01-30 13:08:28
问题 How can i change my code to make it work on sms32v50? .data #storing data startmsg: .asciiz "Pick a number between 1 and 100.\n\n" guessmsg: .asciiz "Enter your guess\n" tooHigh: .asciiz "Your guess is too high.\n\n" tooLow: .asciiz "Your guess is too low.\n\n" wingame: .asciiz "You have guessed the number. Well done!\n\n" .text #start of program start: jal random add $t0, $zero, $a0 # store random number $a0 in $t0 li $v0, 4 # print string la $a0, startmsg syscall ###########################

what is the correct implementation of the 8-bit Fletcher algorithm in java?

二次信任 提交于 2020-01-24 10:04:04
问题 i am trying to implement the 8-bit fletcher algorithm. I wrote a piece of code that does that but i am not sure if i understood the algorithm correctly. this is my piece of code: public class TestFletcher { public static void main(String[] argv) { String bin = "10010010101111101110101101110011"; char[] cA = bin.toCharArray(); int ckA = 0, ckB = 0; for (int i = 0; i < cA.length; i++){ ckA += Integer.valueOf(cA[i])/49; ckB += ckA; } System.out.println(ckA); System.out.println(ckB); } the

what is the correct implementation of the 8-bit Fletcher algorithm in java?

一世执手 提交于 2020-01-24 10:04:01
问题 i am trying to implement the 8-bit fletcher algorithm. I wrote a piece of code that does that but i am not sure if i understood the algorithm correctly. this is my piece of code: public class TestFletcher { public static void main(String[] argv) { String bin = "10010010101111101110101101110011"; char[] cA = bin.toCharArray(); int ckA = 0, ckB = 0; for (int i = 0; i < cA.length; i++){ ckA += Integer.valueOf(cA[i])/49; ckB += ckA; } System.out.println(ckA); System.out.println(ckB); } the

OpenGL - Animate/cycle/rotate palette

佐手、 提交于 2019-12-25 08:29:51
问题 I was trying to create a OpenGL version of an old plasma 8bit effect animation in DOS but I am stuck. Since almost every OpenGL program has included something to generate a palette for Win32 I thought it would not be that hard to apply palette animation on my old program. My purpose is to generate a texture with color indices that does not change and a palette that is rotating. After digging into the web this weekend I am still not able to fix it. I cannot even display a texture with one

Does R support 8bit variables?

僤鯓⒐⒋嵵緔 提交于 2019-12-25 05:22:34
问题 I am trying to read a large (~700Mb) .csv file into R. The file contains an array of integers less than 256, with a header row and 2 header columns. I use: trainSet <- read.csv(trainFileName) This eventually barfs with: Loading Data... R(2760) malloc: *** mmap(size=151552) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug R(2760) malloc: *** mmap(size=151552) failed (error code=12) *** error: can't allocate region *** set a breakpoint

Pillow convert png to 8bit bitmap

放肆的年华 提交于 2019-12-24 19:19:11
问题 i tried to convert 8bit PNGs to 8bit(256indexed palette) Bitmap image, but Pillow is keep vomiting crappy outcome. this is what i tried. image = Image.open(file) image = image.convert('P') pp = image.getpalette() pp[0] = 255 pp[1] = 0 pp[2] = 255 image.putpalette(pp) or image = Image.open(file) image = image.convert('P') image.save(blabla.bmp) and this is the outcome what i expected to see. this is an actual bitmap(done by Photoshop.) Photoshop and this is what Pillow did: Pillow what kind of

python opencv SIFT doesn't work for 8 bit images (JPEG)

自作多情 提交于 2019-12-24 04:22:16
问题 I used SIFT for all my other 24 bit JPEG images without any problems, however, the 8 bit one always give me this following error. image is empty or has incorrect depth (!=CV_8U) in function cv::SIFT::operator () Does anyone know how to deal with it? Here is my code: import cv2 import numpy as np import os import glob import scipy.cluster os.chdir('\mydirectory') images = [] for infile in glob.glob('./*.jpg'): pic = cv2.imread(infile,0) images.append(pic) my_set = images descriptors = np.array